https://www.acmicpc.net/problem/18870
5 2 4 -10 4 -9
2 3 0 3 1
6 1000 999 1000 999 1000 999
1 0 1 0 1 0