#P1358E. Are You Fired?

    ID: 5382 Type: RemoteJudge 2000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>constructive algorithmsdata structuresgreedyimplementation*2400

Are You Fired?

No submission language available for this problem.

Description

Levian works as an accountant in a large company. Levian knows how much the company has earned in each of the nn consecutive months — in the ii-th month the company had income equal to aia_i (positive income means profit, negative income means loss, zero income means no change). Because of the general self-isolation, the first n2\lceil \tfrac{n}{2} \rceil months income might have been completely unstable, but then everything stabilized and for the last n2\lfloor \tfrac{n}{2} \rfloor months the income was the same.

Levian decided to tell the directors nk+1n-k+1 numbers — the total income of the company for each kk consecutive months. In other words, for each ii between 11 and nk+1n-k+1 he will say the value ai+ai+1++ai+k1a_i + a_{i+1} + \ldots + a_{i + k - 1}. For example, if a=[1,0,1,2,2]a=[-1, 0, 1, 2, 2] and k=3k=3 he will say the numbers 0,3,50, 3, 5.

Unfortunately, if at least one total income reported by Levian is not a profit (income 0\le 0), the directors will get angry and fire the failed accountant.

Save Levian's career: find any such kk, that for each kk months in a row the company had made a profit, or report that it is impossible.

The first line contains a single integer nn (2n51052 \le n \le 5\cdot 10^5) — the number of months for which Levian must account.

The second line contains n2\lceil{\frac{n}{2}}\rceil integers a1,a2,,an2a_1, a_2, \ldots, a_{\lceil{\frac{n}{2}}\rceil}, where aia_i (109ai109-10^9 \le a_i \le 10^9) — the income of the company in the ii-th month.

Third line contains a single integer xx (109x109-10^9 \le x \le 10^9) — income in every month from n2+1\lceil{\frac{n}{2}}\rceil + 1 to nn.

In a single line, print the appropriate integer kk or 1-1, if it does not exist.

If there are multiple possible answers, you can print any.

Input

The first line contains a single integer nn (2n51052 \le n \le 5\cdot 10^5) — the number of months for which Levian must account.

The second line contains n2\lceil{\frac{n}{2}}\rceil integers a1,a2,,an2a_1, a_2, \ldots, a_{\lceil{\frac{n}{2}}\rceil}, where aia_i (109ai109-10^9 \le a_i \le 10^9) — the income of the company in the ii-th month.

Third line contains a single integer xx (109x109-10^9 \le x \le 10^9) — income in every month from n2+1\lceil{\frac{n}{2}}\rceil + 1 to nn.

Output

In a single line, print the appropriate integer kk or 1-1, if it does not exist.

If there are multiple possible answers, you can print any.

Samples

Sample Input 1

3
2 -1
2

Sample Output 1

2

Sample Input 2

5
2 2 -8
2

Sample Output 2

-1

Sample Input 3

6
-2 -2 6
-1

Sample Output 3

4

Note

In the first example, k=2k=2 and k=3k=3 satisfy: in the first case, Levian will report the numbers 1,11, 1, and in the second case — one number 33.

In the second example, there is no such kk.

In the third example, the only answer is k=4k=4: he will report the numbers 1,2,31,2,3.