QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#615848#9182. Infinite Racejxy2012#100 ✓15ms4724kbC++23557b2024-10-05 20:38:092024-10-05 20:38:15

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 29
Accepted

Test #1:

score: 29
Accepted
time: 0ms
memory: 3856kb

input:

2
1
1

output:

0

result:

ok single line: '0'

Test #2:

score: 29
Accepted
time: 0ms
memory: 3852kb

input:

2
2
1
-1

output:

0

result:

ok single line: '0'

Test #3:

score: 29
Accepted
time: 1ms
memory: 3752kb

input:

2
5
-1
-1
-1
-1
1

output:

0

result:

ok single line: '0'

Test #4:

score: 29
Accepted
time: 6ms
memory: 3940kb

input:

2
200000
1
1
-1
-1
-1
1
-1
1
1
1
-1
-1
1
-1
1
1
-1
1
1
-1
-1
1
-1
-1
1
-1
1
-1
1
1
1
1
-1
1
-1
-1
-1
-1
-1
1
1
-1
-1
1
-1
-1
1
1
1
-1
-1
-1
-1
-1
1
-1
-1
1
1
1
-1
1
-1
-1
1
-1
-1
1
1
-1
-1
-1
1
-1
-1
1
-1
-1
-1
1
-1
1
-1
1
-1
-1
1
-1
1
1
-1
1
-1
1
-1
1
-1
1
-1
-1
-1
-1
-1
1
-1
-1
1
1
1
1
1
1
-1
-1
-...

output:

50154

result:

ok single line: '50154'

Test #5:

score: 29
Accepted
time: 4ms
memory: 3944kb

input:

2
200000
1
-1
1
-1
1
1
-1
1
-1
-1
1
-1
1
1
1
1
-1
-1
1
1
1
1
-1
1
-1
1
1
1
-1
-1
1
-1
-1
-1
1
1
1
1
-1
1
1
1
-1
1
1
1
-1
1
1
1
-1
1
1
1
1
1
1
1
-1
-1
1
1
-1
-1
-1
1
-1
-1
-1
-1
-1
1
-1
-1
-1
-1
1
1
1
1
-1
-1
-1
1
-1
-1
-1
-1
1
-1
-1
1
-1
1
1
-1
-1
-1
1
-1
-1
-1
-1
-1
-1
1
1
-1
-1
-1
1
-1
1
1
-1
-1
1...

output:

50172

result:

ok single line: '50172'

Test #6:

score: 29
Accepted
time: 10ms
memory: 3784kb

input:

2
200000
1
1
1
1
1
1
1
1
-1
1
1
1
1
-1
-1
-1
-1
1
-1
-1
1
-1
-1
-1
1
1
1
-1
1
1
-1
1
-1
1
-1
1
-1
-1
1
1
1
1
1
-1
1
1
1
-1
-1
-1
1
-1
1
1
-1
-1
1
-1
1
1
-1
1
-1
-1
-1
1
-1
-1
1
1
-1
-1
1
1
1
-1
-1
-1
-1
1
-1
-1
1
-1
-1
1
1
-1
-1
-1
1
-1
1
1
1
-1
1
1
1
1
-1
1
-1
-1
-1
1
1
1
-1
-1
1
1
-1
1
-1
-1
-1
1
...

output:

49713

result:

ok single line: '49713'

Test #7:

score: 29
Accepted
time: 9ms
memory: 3784kb

input:

2
200000
1
-1
-1
1
-1
1
-1
1
1
-1
1
-1
-1
-1
-1
-1
-1
-1
1
1
-1
1
-1
-1
-1
1
1
1
-1
1
1
-1
1
1
-1
1
-1
1
1
1
1
-1
-1
1
-1
-1
1
1
1
1
-1
-1
1
-1
-1
1
1
-1
1
-1
1
1
1
-1
-1
-1
-1
-1
1
1
-1
-1
1
1
1
1
-1
-1
1
1
-1
-1
-1
-1
1
-1
-1
-1
1
1
1
-1
1
1
-1
1
1
1
-1
1
-1
-1
-1
1
1
-1
1
1
1
-1
1
1
1
1
1
-1
-1
1...

output:

49564

result:

ok single line: '49564'

Test #8:

score: 29
Accepted
time: 0ms
memory: 3880kb

input:

2
100
-1
1
-1
1
-1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
1
1
1
1
1
1
1
-1
-1
1
-1
-1
1
-1
-1
1
1
-1
-1
-1
-1
1
-1
1
-1
-1
1
1
-1
-1
1
-1
-1
-1
-1
1
-1
-1
1
1
-1
-1
1
-1
-1
1
1
-1
-1
1
-1
-1
1
1
-1
-1
-1
1
-1
-1
-1
-1
-1
1
1
1
-1
1
1
1
-1
1
-1
1
1
-1
1
-1
-1
-1
-1

output:

16

result:

ok single line: '16'

Test #9:

score: 29
Accepted
time: 0ms
memory: 3940kb

input:

2
2
1
1

output:

1

result:

ok single line: '1'

Test #10:

score: 29
Accepted
time: 5ms
memory: 3936kb

input:

2
200000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

199999

result:

ok single line: '199999'

Test #11:

score: 29
Accepted
time: 0ms
memory: 3744kb

input:

2
100
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

99

result:

ok single line: '99'

Test #12:

score: 29
Accepted
time: 8ms
memory: 3804kb

input:

2
200000
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-...

output:

0

result:

ok single line: '0'

Test #13:

score: 29
Accepted
time: 0ms
memory: 3876kb

input:

2
100
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1

output:

0

result:

ok single line: '0'

Test #14:

score: 29
Accepted
time: 10ms
memory: 3860kb

input:

2
200000
1
1
1
1
1
1
1
1
1
-1
1
1
-1
-1
-1
1
1
1
-1
1
-1
1
-1
-1
-1
1
-1
1
1
-1
-1
-1
-1
1
1
1
-1
-1
1
-1
1
1
1
1
1
1
-1
1
-1
1
1
-1
-1
-1
1
1
-1
1
1
-1
-1
-1
-1
-1
-1
-1
1
-1
1
1
1
1
1
1
-1
1
-1
-1
-1
1
-1
1
-1
-1
1
1
-1
1
-1
1
1
-1
-1
1
1
1
-1
-1
-1
1
-1
-1
-1
-1
1
1
1
-1
1
1
-1
-1
1
1
-1
-1
1
1
1...

output:

50402

result:

ok single line: '50402'

Test #15:

score: 29
Accepted
time: 0ms
memory: 3944kb

input:

2
100
1
1
1
-1
1
1
1
-1
-1
-1
-1
1
-1
1
1
1
-1
-1
1
1
-1
-1
-1
-1
-1
1
-1
1
-1
-1
1
-1
1
1
1
-1
-1
-1
1
1
1
1
1
1
-1
1
1
-1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
1
-1
-1
-1
-1
1
1
1
-1
1
1
-1
-1
1
1
1
1
-1
-1
-1
1
1
1
1
1
-1
1
-1
-1
-1
1
1
-1
1
-1
-1
-1
1
-1
-1
1
1

output:

27

result:

ok single line: '27'

Test #16:

score: 29
Accepted
time: 10ms
memory: 3852kb

input:

2
200000
1
-1
1
-1
-1
-1
1
1
1
1
1
1
-1
-1
1
1
1
-1
1
1
1
-1
1
-1
1
1
1
1
-1
-1
1
-1
1
-1
-1
1
1
1
1
1
1
-1
-1
1
-1
1
-1
-1
1
-1
1
-1
1
1
-1
-1
1
-1
1
-1
1
1
-1
1
1
1
1
1
1
-1
-1
-1
-1
1
-1
1
1
-1
1
-1
-1
1
-1
-1
-1
-1
1
1
1
-1
-1
1
-1
-1
-1
1
1
-1
1
-1
-1
-1
-1
1
1
-1
1
-1
1
-1
-1
-1
1
-1
-1
-1
1
1...

output:

49885

result:

ok single line: '49885'

Test #17:

score: 29
Accepted
time: 0ms
memory: 3804kb

input:

2
100
1
1
1
1
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
-1
1
1
1
1
1
1
-1
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
-1
1
1
1
1
-1
1
-1
1
1
1
1
1
1
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

84

result:

ok single line: '84'

Test #18:

score: 29
Accepted
time: 8ms
memory: 3848kb

input:

2
200000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

199987

result:

ok single line: '199987'

Test #19:

score: 29
Accepted
time: 0ms
memory: 3852kb

input:

2
4
1
1
1
1

output:

3

result:

ok single line: '3'

Test #20:

score: 29
Accepted
time: 0ms
memory: 3880kb

input:

2
5
1
-1
1
-1
-1

output:

0

result:

ok single line: '0'

Subtask #2:

score: 34
Accepted

Test #21:

score: 34
Accepted
time: 0ms
memory: 3804kb

input:

2
2
1
1

output:

1

result:

ok single line: '1'

Test #22:

score: 34
Accepted
time: 8ms
memory: 3848kb

input:

2
200000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

199999

result:

ok single line: '199999'

Test #23:

score: 34
Accepted
time: 0ms
memory: 3940kb

input:

2
100
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

99

result:

ok single line: '99'

Test #24:

score: 34
Accepted
time: 0ms
memory: 3940kb

input:

100
100
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
1

output:

1

result:

ok single line: '1'

Test #25:

score: 34
Accepted
time: 11ms
memory: 4660kb

input:

200000
200000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
9...

output:

1

result:

ok single line: '1'

Test #26:

score: 34
Accepted
time: 1ms
memory: 4664kb

input:

200000
1
182487

output:

0

result:

ok single line: '0'

Test #27:

score: 34
Accepted
time: 9ms
memory: 3872kb

input:

3
200000
1
2
1
2
2
2
1
1
1
2
2
2
1
2
2
2
2
1
1
2
2
1
2
2
1
2
2
1
2
1
1
2
2
2
2
2
1
2
2
2
1
1
2
1
1
2
2
1
2
2
1
2
2
1
1
2
2
2
2
2
2
1
2
1
1
1
2
1
1
2
1
1
1
2
1
1
2
2
2
1
1
1
1
2
1
2
2
1
2
1
2
1
2
1
2
2
2
1
2
2
2
1
1
1
1
2
1
1
2
2
2
2
1
2
1
2
1
1
2
2
1
1
1
1
1
1
2
2
1
1
1
1
1
1
1
2
2
2
2
2
2
1
1
1
2
2...

output:

133415

result:

ok single line: '133415'

Test #28:

score: 34
Accepted
time: 9ms
memory: 3856kb

input:

4
200000
3
2
1
3
2
2
2
1
1
1
2
3
3
2
1
1
1
3
1
1
3
3
1
1
3
1
2
2
1
2
1
3
2
2
2
2
1
3
1
1
2
2
3
1
1
3
1
3
1
3
3
2
1
2
3
1
1
1
3
2
1
3
2
2
2
3
1
3
2
3
2
2
3
1
1
3
1
2
2
1
2
1
1
1
1
2
2
1
2
2
1
2
2
1
2
2
3
2
3
2
3
1
3
2
3
2
1
3
3
2
3
3
2
3
3
3
3
3
3
2
3
2
2
1
3
2
3
2
3
2
1
1
2
2
3
2
3
1
1
2
3
2
3
3
2
2...

output:

105734

result:

ok single line: '105734'

Test #29:

score: 34
Accepted
time: 9ms
memory: 3940kb

input:

10
200000
3
4
4
8
3
7
3
6
4
2
8
5
3
6
8
6
9
2
7
5
5
4
4
1
9
3
5
5
1
5
2
1
2
8
2
1
8
5
9
1
3
5
7
4
5
2
8
8
8
5
4
2
8
9
7
3
3
1
8
8
3
5
6
4
2
3
9
5
9
1
3
9
6
8
1
7
4
8
9
2
5
5
8
4
4
3
1
3
4
4
7
2
8
2
8
9
3
9
4
7
1
3
5
2
3
7
2
7
3
6
5
3
1
3
1
4
7
8
7
6
6
5
4
2
9
6
8
1
1
4
5
1
8
3
1
7
6
7
1
3
8
6
2
4
4
...

output:

57864

result:

ok single line: '57864'

Test #30:

score: 34
Accepted
time: 10ms
memory: 3940kb

input:

30
200000
18
9
9
18
3
26
1
17
16
14
17
29
13
1
18
27
19
17
29
2
27
27
4
15
15
16
24
12
19
13
17
23
15
5
25
10
26
23
19
17
22
17
3
15
12
2
5
24
7
20
25
25
25
13
13
18
7
8
27
3
23
8
9
11
27
7
12
4
11
9
4
15
20
26
8
22
9
20
20
20
24
19
25
5
12
27
28
11
16
14
16
20
16
28
6
29
1
16
24
11
19
18
21
9
2
14
...

output:

31054

result:

ok single line: '31054'

Test #31:

score: 34
Accepted
time: 10ms
memory: 3856kb

input:

203
200000
100
186
4
75
56
130
181
36
161
3
191
32
73
58
164
195
30
33
131
124
53
99
135
140
1
124
29
89
16
34
161
152
54
188
65
43
181
28
83
169
160
47
44
59
145
195
79
27
176
18
179
144
11
195
36
85
169
90
146
93
73
66
11
155
133
63
90
108
107
90
137
65
143
120
154
94
86
202
122
17
56
71
84
179
11...

output:

11485

result:

ok single line: '11485'

Test #32:

score: 34
Accepted
time: 10ms
memory: 3820kb

input:

4000
200000
2985
3407
1143
3560
1007
1855
1639
590
2231
1529
1435
3586
1692
2369
3019
1377
331
3435
1266
2126
2560
3319
295
303
892
360
3487
2092
2712
3029
626
672
228
3846
493
3026
1981
1196
2227
1411
1463
3677
1658
714
630
860
3156
2080
2963
1977
2485
2147
2792
2299
371
1559
2848
2324
3115
851
347...

output:

2483

result:

ok single line: '2483'

Test #33:

score: 34
Accepted
time: 11ms
memory: 4132kb

input:

50000
200000
41213
30997
8619
41861
41316
30105
15006
5065
11015
16985
31909
37042
39467
40487
19883
28554
27460
15459
25824
13158
13066
35584
18001
12362
2818
25831
41729
38972
7193
37946
26803
47535
24225
38582
11225
18966
7044
30591
39076
47171
26818
48011
43377
14636
38329
19199
26087
4199
27793...

output:

708

result:

ok single line: '708'

Test #34:

score: 34
Accepted
time: 10ms
memory: 4724kb

input:

200000
200000
152734
110923
16496
149622
42618
139250
114608
26400
7774
14830
41079
28404
141560
75920
122036
159829
188426
1794
58069
67219
56319
87589
152026
49931
198814
121631
50352
35306
149116
96622
76915
32475
19261
145376
171230
135192
9951
12008
120134
56675
9658
365
164993
86997
101564
463...

output:

355

result:

ok single line: '355'

Test #35:

score: 34
Accepted
time: 13ms
memory: 4628kb

input:

200000
200000
27246
74011
14368
132003
132822
73717
178219
138282
64714
1226
87554
9175
85526
136668
35925
137518
192376
7331
5282
114513
109561
15792
123812
27275
103776
150744
63065
44068
41587
8571
164073
70684
31713
126280
129481
127543
74628
53503
157457
53412
48385
118805
190850
61145
759
6632...

output:

353

result:

ok single line: '353'

Test #36:

score: 34
Accepted
time: 13ms
memory: 4660kb

input:

200000
200000
38946
72672
90488
178872
198147
148517
21120
135564
141486
146690
158535
117398
53985
61630
32324
166488
191602
182605
17450
10007
44955
2832
164706
106964
73485
47865
180127
177432
153405
118096
34895
53548
1579
27202
181777
187006
169313
126798
137850
77449
194252
194736
143109
17519...

output:

371

result:

ok single line: '371'

Test #37:

score: 34
Accepted
time: 0ms
memory: 3780kb

input:

100
100
92
24
44
6
56
47
78
13
79
24
86
40
7
40
3
33
1
63
9
82
73
40
4
92
88
1
9
77
24
27
22
74
55
26
49
99
64
28
20
49
62
11
78
10
69
76
93
96
18
65
20
2
91
4
81
61
41
29
18
3
93
6
31
7
91
58
78
46
56
69
92
46
96
36
22
84
4
8
62
64
61
38
91
2
87
46
27
63
35
55
10
7
74
60
73
45
83
94
40
70

output:

7

result:

ok single line: '7'

Test #38:

score: 34
Accepted
time: 0ms
memory: 3884kb

input:

100
100
26
26
11
16
83
11
16
16
11
26
11
16
11
16
26
16
11
16
99
16
11
26
26
11
16
27
26
11
16
11
11
11
11
16
26
92
16
16
11
26
16
11
26
16
16
26
16
16
11
11
26
16
26
11
11
26
1
11
2
11
11
11
11
16
16
16
26
11
11
80
16
26
16
26
26
11
11
26
16
35
26
26
26
38
11
11
11
16
16
16
26
16
20
11
26
26
16
26
...

output:

46

result:

ok single line: '46'

Test #39:

score: 34
Accepted
time: 12ms
memory: 4532kb

input:

200000
200000
29665
27299
91359
91359
29665
91359
91359
91359
91359
29665
27299
27299
29665
23871
91359
91359
29665
91359
27299
27299
91359
29665
27299
37574
91359
29665
91359
52912
91359
27299
29665
27299
27299
27299
27299
29665
30652
91359
29665
29665
91359
29665
27299
81391
27299
91359
27299
2966...

output:

95191

result:

ok single line: '95191'

Test #40:

score: 34
Accepted
time: 0ms
memory: 3940kb

input:

100
100
66
66
8
8
45
45
97
97
58
58
34
34
71
71
20
69
69
54
54
53
53
43
43
88
88
34
34
76
76
74
74
62
62
42
42
50
50
89
89
66
66
44
44
56
56
96
96
33
33
15
20
15
24
24
12
12
64
64
46
46
21
21
15
15
92
99
99
68
41
87
87
64
64
17
17
73
73
58
44
66
58
92
92
68
68
51
49
49
52
6
49
52
7
7
71
71
50
50
95
95

output:

45

result:

ok single line: '45'

Test #41:

score: 34
Accepted
time: 13ms
memory: 4640kb

input:

200000
200000
48508
48508
192753
192753
128554
128554
9725
9725
81029
81029
24266
24266
94313
94313
153565
153565
64878
64878
24712
24712
50046
50046
196752
196752
140257
140257
72031
72031
180537
180537
68161
68161
30314
30314
179259
179259
162787
162787
11787
11787
21698
21698
179267
179267
154017...

output:

99995

result:

ok single line: '99995'

Test #42:

score: 34
Accepted
time: 0ms
memory: 3860kb

input:

2
4
1
1
1
1

output:

3

result:

ok single line: '3'

Test #43:

score: 34
Accepted
time: 1ms
memory: 4596kb

input:

200000
7
199999
199999
1
199999
55
199999
55

output:

3

result:

ok single line: '3'

Test #44:

score: 34
Accepted
time: 0ms
memory: 3940kb

input:

3
6
1
2
2
2
1
1

output:

3

result:

ok single line: '3'

Subtask #3:

score: 22
Accepted

Test #45:

score: 22
Accepted
time: 0ms
memory: 3780kb

input:

2
1
1

output:

0

result:

ok single line: '0'

Test #46:

score: 22
Accepted
time: 0ms
memory: 3804kb

input:

2
2
1
-1

output:

0

result:

ok single line: '0'

Test #47:

score: 22
Accepted
time: 0ms
memory: 3856kb

input:

2
5
-1
-1
-1
-1
1

output:

0

result:

ok single line: '0'

Test #48:

score: 22
Accepted
time: 0ms
memory: 3876kb

input:

2
100
-1
1
-1
1
-1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
1
1
1
1
1
1
1
-1
-1
1
-1
-1
1
-1
-1
1
1
-1
-1
-1
-1
1
-1
1
-1
-1
1
1
-1
-1
1
-1
-1
-1
-1
1
-1
-1
1
1
-1
-1
1
-1
-1
1
1
-1
-1
1
-1
-1
1
1
-1
-1
-1
1
-1
-1
-1
-1
-1
1
1
1
-1
1
1
1
-1
1
-1
1
1
-1
1
-1
-1
-1
-1

output:

16

result:

ok single line: '16'

Test #49:

score: 22
Accepted
time: 0ms
memory: 3852kb

input:

2
2
1
1

output:

1

result:

ok single line: '1'

Test #50:

score: 22
Accepted
time: 0ms
memory: 3940kb

input:

2
100
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

99

result:

ok single line: '99'

Test #51:

score: 22
Accepted
time: 0ms
memory: 3748kb

input:

2
100
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1

output:

0

result:

ok single line: '0'

Test #52:

score: 22
Accepted
time: 0ms
memory: 3864kb

input:

2
100
1
1
1
-1
1
1
1
-1
-1
-1
-1
1
-1
1
1
1
-1
-1
1
1
-1
-1
-1
-1
-1
1
-1
1
-1
-1
1
-1
1
1
1
-1
-1
-1
1
1
1
1
1
1
-1
1
1
-1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
1
-1
-1
-1
-1
1
1
1
-1
1
1
-1
-1
1
1
1
1
-1
-1
-1
1
1
1
1
1
-1
1
-1
-1
-1
1
1
-1
1
-1
-1
-1
1
-1
-1
1
1

output:

27

result:

ok single line: '27'

Test #53:

score: 22
Accepted
time: 0ms
memory: 3944kb

input:

2
100
1
1
1
1
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
-1
1
1
1
1
1
1
-1
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
-1
1
1
1
1
-1
1
-1
1
1
1
1
1
1
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

84

result:

ok single line: '84'

Test #54:

score: 22
Accepted
time: 0ms
memory: 3852kb

input:

100
100
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
1

output:

1

result:

ok single line: '1'

Test #55:

score: 22
Accepted
time: 0ms
memory: 3800kb

input:

100
100
92
24
44
6
56
47
78
13
79
24
86
40
7
40
3
33
1
63
9
82
73
40
4
92
88
1
9
77
24
27
22
74
55
26
49
99
64
28
20
49
62
11
78
10
69
76
93
96
18
65
20
2
91
4
81
61
41
29
18
3
93
6
31
7
91
58
78
46
56
69
92
46
96
36
22
84
4
8
62
64
61
38
91
2
87
46
27
63
35
55
10
7
74
60
73
45
83
94
40
70

output:

7

result:

ok single line: '7'

Test #56:

score: 22
Accepted
time: 0ms
memory: 3944kb

input:

100
100
26
26
11
16
83
11
16
16
11
26
11
16
11
16
26
16
11
16
99
16
11
26
26
11
16
27
26
11
16
11
11
11
11
16
26
92
16
16
11
26
16
11
26
16
16
26
16
16
11
11
26
16
26
11
11
26
1
11
2
11
11
11
11
16
16
16
26
11
11
80
16
26
16
26
26
11
11
26
16
35
26
26
26
38
11
11
11
16
16
16
26
16
20
11
26
26
16
26
...

output:

46

result:

ok single line: '46'

Test #57:

score: 22
Accepted
time: 0ms
memory: 3856kb

input:

100
100
66
66
8
8
45
45
97
97
58
58
34
34
71
71
20
69
69
54
54
53
53
43
43
88
88
34
34
76
76
74
74
62
62
42
42
50
50
89
89
66
66
44
44
56
56
96
96
33
33
15
20
15
24
24
12
12
64
64
46
46
21
21
15
15
92
99
99
68
41
87
87
64
64
17
17
73
73
58
44
66
58
92
92
68
68
51
49
49
52
6
49
52
7
7
71
71
50
50
95
95

output:

45

result:

ok single line: '45'

Test #58:

score: 22
Accepted
time: 0ms
memory: 3788kb

input:

100
100
-14
29
-84
-95
83
83
90
-29
5
1
22
-32
23
-53
38
89
53
-46
-69
-69
-60
-40
-33
-91
-81
3
55
47
5
42
31
-58
-98
-49
74
-29
3
-92
-17
81
58
54
-24
14
82
98
33
43
-66
-6
16
14
26
-19
-57
-51
-86
30
-62
34
-23
-25
10
-45
5
25
-60
-89
7
6
-77
-30
-47
-99
-73
80
-59
85
-94
14
-86
-70
63
-58
87
32
...

output:

4

result:

ok single line: '4'

Test #59:

score: 22
Accepted
time: 0ms
memory: 3780kb

input:

100
100
35
-91
-76
62
-76
51
-71
-19
-44
-76
86
84
88
13
-25
-76
38
-97
23
-77
-80
-56
68
56
-3
79
17
22
-64
54
-90
20
84
4
15
-7
-23
-35
73
85
-33
50
-85
-72
84
-94
48
-84
-67
-71
-69
-57
-47
10
-58
22
26
51
-53
-77
-29
-91
5
66
21
-85
45
-37
91
2
-19
78
56
22
21
49
-5
-26
-73
12
-50
36
24
-64
-91
...

output:

3

result:

ok single line: '3'

Test #60:

score: 22
Accepted
time: 0ms
memory: 3856kb

input:

100
100
-99
-63
-4
-16
-7
-49
-41
-55
-70
-11
-65
-42
-98
-85
-25
-52
-30
-72
98
-79
99
70
-73
-53
-93
-46
-2
-19
19
2
4
-59
-90
-82
90
-40
-18
-34
-4
-87
85
82
46
-67
-36
-19
52
-35
-37
-31
-96
49
-28
-15
-99
-52
-71
-88
-95
-90
-12
37
72
19
-2
-94
-85
-54
-20
11
88
25
96
-43
-83
-48
7
-25
59
95
-9...

output:

0

result:

ok single line: '0'

Test #61:

score: 22
Accepted
time: 0ms
memory: 3856kb

input:

100
100
1
2
3
4
-5
-6
7
8
9
-10
-11
-12
-13
14
15
-16
17
18
-19
-20
-21
22
23
24
25
-26
27
28
-29
-30
31
-32
33
-34
35
-36
-37
-38
39
-40
41
42
-43
44
-45
-46
47
48
49
50
-51
52
53
54
-55
-56
-57
-58
59
60
-61
62
63
-64
-65
-66
67
-68
-69
70
-71
72
-73
-74
75
-76
-77
78
-79
80
81
-82
83
-84
-85
86
8...

output:

0

result:

ok single line: '0'

Test #62:

score: 22
Accepted
time: 0ms
memory: 3940kb

input:

100
100
71
71
-77
71
-71
81
-71
71
-71
77
77
-77
-71
-71
-71
-24
77
71
51
-71
22
71
71
77
77
-71
-71
23
71
-71
71
-7
77
-77
-50
71
77
64
-77
-71
71
71
71
77
77
-77
-42
-77
-77
71
71
-71
71
-71
71
77
56
-71
71
-77
71
71
-71
71
71
77
77
71
10
-71
71
71
71
77
-71
12
71
-77
-71
71
71
-71
-77
-71
-71
-71...

output:

21

result:

ok single line: '21'

Test #63:

score: 22
Accepted
time: 0ms
memory: 3860kb

input:

100
100
-45
-68
-7
-1
-82
-22
-89
-7
-20
-50
-38
-79
-9
-87
-11
-35
-61
-45
-24
-95
-43
-39
-81
-92
-62
-81
-70
-91
-7
-73
-45
-26
-22
-76
-27
-46
-51
-42
-17
-11
-11
-95
-50
-79
-18
-34
-56
-3
-21
-93
-71
-49
-51
-7
-75
-84
-65
-25
-17
-56
-43
-17
-88
-29
-44
-60
-41
-80
-78
-30
-78
-96
-46
-82
-31...

output:

0

result:

ok single line: '0'

Test #64:

score: 22
Accepted
time: 0ms
memory: 3944kb

input:

100
100
11
11
24
24
67
67
97
97
17
17
28
28
29
29
71
71
24
24
41
41
64
64
18
-70
18
10
10
24
24
52
52
7
7
87
87
85
85
89
89
69
76
69
13
21
21
45
45
2
2
-60
25
25
61
61
33
33
41
41
65
65
94
94
82
82
38
-79
24
38
-23
20
-3
20
17
17
73
73
47
47
90
90
65
65
7
7
98
98
57
57
15
15
8
16
8
14
14
88
88
50
50...

output:

45

result:

ok single line: '45'

Test #65:

score: 22
Accepted
time: 0ms
memory: 3804kb

input:

4
5
-2
2
1
-3
2

output:

1

result:

ok single line: '1'

Test #66:

score: 22
Accepted
time: 0ms
memory: 3856kb

input:

2
4
1
1
1
1

output:

3

result:

ok single line: '3'

Test #67:

score: 22
Accepted
time: 0ms
memory: 3752kb

input:

2
5
1
-1
1
-1
-1

output:

0

result:

ok single line: '0'

Test #68:

score: 22
Accepted
time: 0ms
memory: 3876kb

input:

3
6
1
2
2
2
1
1

output:

3

result:

ok single line: '3'

Subtask #4:

score: 15
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #69:

score: 15
Accepted
time: 0ms
memory: 3748kb

input:

2
1
1

output:

0

result:

ok single line: '0'

Test #70:

score: 15
Accepted
time: 0ms
memory: 3856kb

input:

2
2
1
-1

output:

0

result:

ok single line: '0'

Test #71:

score: 15
Accepted
time: 0ms
memory: 3784kb

input:

2
5
-1
-1
-1
-1
1

output:

0

result:

ok single line: '0'

Test #72:

score: 15
Accepted
time: 9ms
memory: 3848kb

input:

2
200000
1
1
-1
-1
-1
1
-1
1
1
1
-1
-1
1
-1
1
1
-1
1
1
-1
-1
1
-1
-1
1
-1
1
-1
1
1
1
1
-1
1
-1
-1
-1
-1
-1
1
1
-1
-1
1
-1
-1
1
1
1
-1
-1
-1
-1
-1
1
-1
-1
1
1
1
-1
1
-1
-1
1
-1
-1
1
1
-1
-1
-1
1
-1
-1
1
-1
-1
-1
1
-1
1
-1
1
-1
-1
1
-1
1
1
-1
1
-1
1
-1
1
-1
1
-1
-1
-1
-1
-1
1
-1
-1
1
1
1
1
1
1
-1
-1
-...

output:

50154

result:

ok single line: '50154'

Test #73:

score: 15
Accepted
time: 9ms
memory: 3940kb

input:

2
200000
1
-1
1
-1
1
1
-1
1
-1
-1
1
-1
1
1
1
1
-1
-1
1
1
1
1
-1
1
-1
1
1
1
-1
-1
1
-1
-1
-1
1
1
1
1
-1
1
1
1
-1
1
1
1
-1
1
1
1
-1
1
1
1
1
1
1
1
-1
-1
1
1
-1
-1
-1
1
-1
-1
-1
-1
-1
1
-1
-1
-1
-1
1
1
1
1
-1
-1
-1
1
-1
-1
-1
-1
1
-1
-1
1
-1
1
1
-1
-1
-1
1
-1
-1
-1
-1
-1
-1
1
1
-1
-1
-1
1
-1
1
1
-1
-1
1...

output:

50172

result:

ok single line: '50172'

Test #74:

score: 15
Accepted
time: 9ms
memory: 3784kb

input:

2
200000
1
1
1
1
1
1
1
1
-1
1
1
1
1
-1
-1
-1
-1
1
-1
-1
1
-1
-1
-1
1
1
1
-1
1
1
-1
1
-1
1
-1
1
-1
-1
1
1
1
1
1
-1
1
1
1
-1
-1
-1
1
-1
1
1
-1
-1
1
-1
1
1
-1
1
-1
-1
-1
1
-1
-1
1
1
-1
-1
1
1
1
-1
-1
-1
-1
1
-1
-1
1
-1
-1
1
1
-1
-1
-1
1
-1
1
1
1
-1
1
1
1
1
-1
1
-1
-1
-1
1
1
1
-1
-1
1
1
-1
1
-1
-1
-1
1
...

output:

49713

result:

ok single line: '49713'

Test #75:

score: 15
Accepted
time: 10ms
memory: 3848kb

input:

2
200000
1
-1
-1
1
-1
1
-1
1
1
-1
1
-1
-1
-1
-1
-1
-1
-1
1
1
-1
1
-1
-1
-1
1
1
1
-1
1
1
-1
1
1
-1
1
-1
1
1
1
1
-1
-1
1
-1
-1
1
1
1
1
-1
-1
1
-1
-1
1
1
-1
1
-1
1
1
1
-1
-1
-1
-1
-1
1
1
-1
-1
1
1
1
1
-1
-1
1
1
-1
-1
-1
-1
1
-1
-1
-1
1
1
1
-1
1
1
-1
1
1
1
-1
1
-1
-1
-1
1
1
-1
1
1
1
-1
1
1
1
1
1
-1
-1
1...

output:

49564

result:

ok single line: '49564'

Test #76:

score: 15
Accepted
time: 0ms
memory: 3856kb

input:

2
100
-1
1
-1
1
-1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
1
1
1
1
1
1
1
-1
-1
1
-1
-1
1
-1
-1
1
1
-1
-1
-1
-1
1
-1
1
-1
-1
1
1
-1
-1
1
-1
-1
-1
-1
1
-1
-1
1
1
-1
-1
1
-1
-1
1
1
-1
-1
1
-1
-1
1
1
-1
-1
-1
1
-1
-1
-1
-1
-1
1
1
1
-1
1
1
1
-1
1
-1
1
1
-1
1
-1
-1
-1
-1

output:

16

result:

ok single line: '16'

Test #77:

score: 15
Accepted
time: 0ms
memory: 3872kb

input:

2
2
1
1

output:

1

result:

ok single line: '1'

Test #78:

score: 15
Accepted
time: 8ms
memory: 3860kb

input:

2
200000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

199999

result:

ok single line: '199999'

Test #79:

score: 15
Accepted
time: 0ms
memory: 3784kb

input:

2
100
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

99

result:

ok single line: '99'

Test #80:

score: 15
Accepted
time: 8ms
memory: 3860kb

input:

2
200000
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-...

output:

0

result:

ok single line: '0'

Test #81:

score: 15
Accepted
time: 0ms
memory: 3752kb

input:

2
100
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1

output:

0

result:

ok single line: '0'

Test #82:

score: 15
Accepted
time: 10ms
memory: 3856kb

input:

2
200000
1
1
1
1
1
1
1
1
1
-1
1
1
-1
-1
-1
1
1
1
-1
1
-1
1
-1
-1
-1
1
-1
1
1
-1
-1
-1
-1
1
1
1
-1
-1
1
-1
1
1
1
1
1
1
-1
1
-1
1
1
-1
-1
-1
1
1
-1
1
1
-1
-1
-1
-1
-1
-1
-1
1
-1
1
1
1
1
1
1
-1
1
-1
-1
-1
1
-1
1
-1
-1
1
1
-1
1
-1
1
1
-1
-1
1
1
1
-1
-1
-1
1
-1
-1
-1
-1
1
1
1
-1
1
1
-1
-1
1
1
-1
-1
1
1
1...

output:

50402

result:

ok single line: '50402'

Test #83:

score: 15
Accepted
time: 0ms
memory: 3792kb

input:

2
100
1
1
1
-1
1
1
1
-1
-1
-1
-1
1
-1
1
1
1
-1
-1
1
1
-1
-1
-1
-1
-1
1
-1
1
-1
-1
1
-1
1
1
1
-1
-1
-1
1
1
1
1
1
1
-1
1
1
-1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
1
-1
-1
-1
-1
1
1
1
-1
1
1
-1
-1
1
1
1
1
-1
-1
-1
1
1
1
1
1
-1
1
-1
-1
-1
1
1
-1
1
-1
-1
-1
1
-1
-1
1
1

output:

27

result:

ok single line: '27'

Test #84:

score: 15
Accepted
time: 10ms
memory: 3860kb

input:

2
200000
1
-1
1
-1
-1
-1
1
1
1
1
1
1
-1
-1
1
1
1
-1
1
1
1
-1
1
-1
1
1
1
1
-1
-1
1
-1
1
-1
-1
1
1
1
1
1
1
-1
-1
1
-1
1
-1
-1
1
-1
1
-1
1
1
-1
-1
1
-1
1
-1
1
1
-1
1
1
1
1
1
1
-1
-1
-1
-1
1
-1
1
1
-1
1
-1
-1
1
-1
-1
-1
-1
1
1
1
-1
-1
1
-1
-1
-1
1
1
-1
1
-1
-1
-1
-1
1
1
-1
1
-1
1
-1
-1
-1
1
-1
-1
-1
1
1...

output:

49885

result:

ok single line: '49885'

Test #85:

score: 15
Accepted
time: 0ms
memory: 3784kb

input:

2
100
1
1
1
1
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
-1
1
1
1
1
1
1
-1
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
-1
1
1
1
1
-1
1
-1
1
1
1
1
1
1
-1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

84

result:

ok single line: '84'

Test #86:

score: 15
Accepted
time: 8ms
memory: 3940kb

input:

2
200000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1...

output:

199987

result:

ok single line: '199987'

Test #87:

score: 15
Accepted
time: 0ms
memory: 3856kb

input:

100
100
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
1

output:

1

result:

ok single line: '1'

Test #88:

score: 15
Accepted
time: 11ms
memory: 4524kb

input:

200000
200000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
9...

output:

1

result:

ok single line: '1'

Test #89:

score: 15
Accepted
time: 1ms
memory: 4720kb

input:

200000
1
182487

output:

0

result:

ok single line: '0'

Test #90:

score: 15
Accepted
time: 9ms
memory: 3852kb

input:

3
200000
1
2
1
2
2
2
1
1
1
2
2
2
1
2
2
2
2
1
1
2
2
1
2
2
1
2
2
1
2
1
1
2
2
2
2
2
1
2
2
2
1
1
2
1
1
2
2
1
2
2
1
2
2
1
1
2
2
2
2
2
2
1
2
1
1
1
2
1
1
2
1
1
1
2
1
1
2
2
2
1
1
1
1
2
1
2
2
1
2
1
2
1
2
1
2
2
2
1
2
2
2
1
1
1
1
2
1
1
2
2
2
2
1
2
1
2
1
1
2
2
1
1
1
1
1
1
2
2
1
1
1
1
1
1
1
2
2
2
2
2
2
1
1
1
2
2...

output:

133415

result:

ok single line: '133415'

Test #91:

score: 15
Accepted
time: 9ms
memory: 3880kb

input:

4
200000
3
2
1
3
2
2
2
1
1
1
2
3
3
2
1
1
1
3
1
1
3
3
1
1
3
1
2
2
1
2
1
3
2
2
2
2
1
3
1
1
2
2
3
1
1
3
1
3
1
3
3
2
1
2
3
1
1
1
3
2
1
3
2
2
2
3
1
3
2
3
2
2
3
1
1
3
1
2
2
1
2
1
1
1
1
2
2
1
2
2
1
2
2
1
2
2
3
2
3
2
3
1
3
2
3
2
1
3
3
2
3
3
2
3
3
3
3
3
3
2
3
2
2
1
3
2
3
2
3
2
1
1
2
2
3
2
3
1
1
2
3
2
3
3
2
2...

output:

105734

result:

ok single line: '105734'

Test #92:

score: 15
Accepted
time: 9ms
memory: 3800kb

input:

10
200000
3
4
4
8
3
7
3
6
4
2
8
5
3
6
8
6
9
2
7
5
5
4
4
1
9
3
5
5
1
5
2
1
2
8
2
1
8
5
9
1
3
5
7
4
5
2
8
8
8
5
4
2
8
9
7
3
3
1
8
8
3
5
6
4
2
3
9
5
9
1
3
9
6
8
1
7
4
8
9
2
5
5
8
4
4
3
1
3
4
4
7
2
8
2
8
9
3
9
4
7
1
3
5
2
3
7
2
7
3
6
5
3
1
3
1
4
7
8
7
6
6
5
4
2
9
6
8
1
1
4
5
1
8
3
1
7
6
7
1
3
8
6
2
4
4
...

output:

57864

result:

ok single line: '57864'

Test #93:

score: 15
Accepted
time: 9ms
memory: 3936kb

input:

30
200000
18
9
9
18
3
26
1
17
16
14
17
29
13
1
18
27
19
17
29
2
27
27
4
15
15
16
24
12
19
13
17
23
15
5
25
10
26
23
19
17
22
17
3
15
12
2
5
24
7
20
25
25
25
13
13
18
7
8
27
3
23
8
9
11
27
7
12
4
11
9
4
15
20
26
8
22
9
20
20
20
24
19
25
5
12
27
28
11
16
14
16
20
16
28
6
29
1
16
24
11
19
18
21
9
2
14
...

output:

31054

result:

ok single line: '31054'

Test #94:

score: 15
Accepted
time: 10ms
memory: 3748kb

input:

203
200000
100
186
4
75
56
130
181
36
161
3
191
32
73
58
164
195
30
33
131
124
53
99
135
140
1
124
29
89
16
34
161
152
54
188
65
43
181
28
83
169
160
47
44
59
145
195
79
27
176
18
179
144
11
195
36
85
169
90
146
93
73
66
11
155
133
63
90
108
107
90
137
65
143
120
154
94
86
202
122
17
56
71
84
179
11...

output:

11485

result:

ok single line: '11485'

Test #95:

score: 15
Accepted
time: 7ms
memory: 3872kb

input:

4000
200000
2985
3407
1143
3560
1007
1855
1639
590
2231
1529
1435
3586
1692
2369
3019
1377
331
3435
1266
2126
2560
3319
295
303
892
360
3487
2092
2712
3029
626
672
228
3846
493
3026
1981
1196
2227
1411
1463
3677
1658
714
630
860
3156
2080
2963
1977
2485
2147
2792
2299
371
1559
2848
2324
3115
851
347...

output:

2483

result:

ok single line: '2483'

Test #96:

score: 15
Accepted
time: 11ms
memory: 4064kb

input:

50000
200000
41213
30997
8619
41861
41316
30105
15006
5065
11015
16985
31909
37042
39467
40487
19883
28554
27460
15459
25824
13158
13066
35584
18001
12362
2818
25831
41729
38972
7193
37946
26803
47535
24225
38582
11225
18966
7044
30591
39076
47171
26818
48011
43377
14636
38329
19199
26087
4199
27793...

output:

708

result:

ok single line: '708'

Test #97:

score: 15
Accepted
time: 13ms
memory: 4640kb

input:

200000
200000
152734
110923
16496
149622
42618
139250
114608
26400
7774
14830
41079
28404
141560
75920
122036
159829
188426
1794
58069
67219
56319
87589
152026
49931
198814
121631
50352
35306
149116
96622
76915
32475
19261
145376
171230
135192
9951
12008
120134
56675
9658
365
164993
86997
101564
463...

output:

355

result:

ok single line: '355'

Test #98:

score: 15
Accepted
time: 8ms
memory: 4656kb

input:

200000
200000
27246
74011
14368
132003
132822
73717
178219
138282
64714
1226
87554
9175
85526
136668
35925
137518
192376
7331
5282
114513
109561
15792
123812
27275
103776
150744
63065
44068
41587
8571
164073
70684
31713
126280
129481
127543
74628
53503
157457
53412
48385
118805
190850
61145
759
6632...

output:

353

result:

ok single line: '353'

Test #99:

score: 15
Accepted
time: 13ms
memory: 4584kb

input:

200000
200000
38946
72672
90488
178872
198147
148517
21120
135564
141486
146690
158535
117398
53985
61630
32324
166488
191602
182605
17450
10007
44955
2832
164706
106964
73485
47865
180127
177432
153405
118096
34895
53548
1579
27202
181777
187006
169313
126798
137850
77449
194252
194736
143109
17519...

output:

371

result:

ok single line: '371'

Test #100:

score: 15
Accepted
time: 0ms
memory: 3856kb

input:

100
100
92
24
44
6
56
47
78
13
79
24
86
40
7
40
3
33
1
63
9
82
73
40
4
92
88
1
9
77
24
27
22
74
55
26
49
99
64
28
20
49
62
11
78
10
69
76
93
96
18
65
20
2
91
4
81
61
41
29
18
3
93
6
31
7
91
58
78
46
56
69
92
46
96
36
22
84
4
8
62
64
61
38
91
2
87
46
27
63
35
55
10
7
74
60
73
45
83
94
40
70

output:

7

result:

ok single line: '7'

Test #101:

score: 15
Accepted
time: 0ms
memory: 3780kb

input:

100
100
26
26
11
16
83
11
16
16
11
26
11
16
11
16
26
16
11
16
99
16
11
26
26
11
16
27
26
11
16
11
11
11
11
16
26
92
16
16
11
26
16
11
26
16
16
26
16
16
11
11
26
16
26
11
11
26
1
11
2
11
11
11
11
16
16
16
26
11
11
80
16
26
16
26
26
11
11
26
16
35
26
26
26
38
11
11
11
16
16
16
26
16
20
11
26
26
16
26
...

output:

46

result:

ok single line: '46'

Test #102:

score: 15
Accepted
time: 12ms
memory: 4564kb

input:

200000
200000
29665
27299
91359
91359
29665
91359
91359
91359
91359
29665
27299
27299
29665
23871
91359
91359
29665
91359
27299
27299
91359
29665
27299
37574
91359
29665
91359
52912
91359
27299
29665
27299
27299
27299
27299
29665
30652
91359
29665
29665
91359
29665
27299
81391
27299
91359
27299
2966...

output:

95191

result:

ok single line: '95191'

Test #103:

score: 15
Accepted
time: 0ms
memory: 3864kb

input:

100
100
66
66
8
8
45
45
97
97
58
58
34
34
71
71
20
69
69
54
54
53
53
43
43
88
88
34
34
76
76
74
74
62
62
42
42
50
50
89
89
66
66
44
44
56
56
96
96
33
33
15
20
15
24
24
12
12
64
64
46
46
21
21
15
15
92
99
99
68
41
87
87
64
64
17
17
73
73
58
44
66
58
92
92
68
68
51
49
49
52
6
49
52
7
7
71
71
50
50
95
95

output:

45

result:

ok single line: '45'

Test #104:

score: 15
Accepted
time: 13ms
memory: 4524kb

input:

200000
200000
48508
48508
192753
192753
128554
128554
9725
9725
81029
81029
24266
24266
94313
94313
153565
153565
64878
64878
24712
24712
50046
50046
196752
196752
140257
140257
72031
72031
180537
180537
68161
68161
30314
30314
179259
179259
162787
162787
11787
11787
21698
21698
179267
179267
154017...

output:

99995

result:

ok single line: '99995'

Test #105:

score: 15
Accepted
time: 0ms
memory: 3848kb

input:

100
100
-14
29
-84
-95
83
83
90
-29
5
1
22
-32
23
-53
38
89
53
-46
-69
-69
-60
-40
-33
-91
-81
3
55
47
5
42
31
-58
-98
-49
74
-29
3
-92
-17
81
58
54
-24
14
82
98
33
43
-66
-6
16
14
26
-19
-57
-51
-86
30
-62
34
-23
-25
10
-45
5
25
-60
-89
7
6
-77
-30
-47
-99
-73
80
-59
85
-94
14
-86
-70
63
-58
87
32
...

output:

4

result:

ok single line: '4'

Test #106:

score: 15
Accepted
time: 0ms
memory: 3788kb

input:

100
100
35
-91
-76
62
-76
51
-71
-19
-44
-76
86
84
88
13
-25
-76
38
-97
23
-77
-80
-56
68
56
-3
79
17
22
-64
54
-90
20
84
4
15
-7
-23
-35
73
85
-33
50
-85
-72
84
-94
48
-84
-67
-71
-69
-57
-47
10
-58
22
26
51
-53
-77
-29
-91
5
66
21
-85
45
-37
91
2
-19
78
56
22
21
49
-5
-26
-73
12
-50
36
24
-64
-91
...

output:

3

result:

ok single line: '3'

Test #107:

score: 15
Accepted
time: 0ms
memory: 3940kb

input:

100
100
-99
-63
-4
-16
-7
-49
-41
-55
-70
-11
-65
-42
-98
-85
-25
-52
-30
-72
98
-79
99
70
-73
-53
-93
-46
-2
-19
19
2
4
-59
-90
-82
90
-40
-18
-34
-4
-87
85
82
46
-67
-36
-19
52
-35
-37
-31
-96
49
-28
-15
-99
-52
-71
-88
-95
-90
-12
37
72
19
-2
-94
-85
-54
-20
11
88
25
96
-43
-83
-48
7
-25
59
95
-9...

output:

0

result:

ok single line: '0'

Test #108:

score: 15
Accepted
time: 0ms
memory: 3860kb

input:

100
100
1
2
3
4
-5
-6
7
8
9
-10
-11
-12
-13
14
15
-16
17
18
-19
-20
-21
22
23
24
25
-26
27
28
-29
-30
31
-32
33
-34
35
-36
-37
-38
39
-40
41
42
-43
44
-45
-46
47
48
49
50
-51
52
53
54
-55
-56
-57
-58
59
60
-61
62
63
-64
-65
-66
67
-68
-69
70
-71
72
-73
-74
75
-76
-77
78
-79
80
81
-82
83
-84
-85
86
8...

output:

0

result:

ok single line: '0'

Test #109:

score: 15
Accepted
time: 0ms
memory: 3944kb

input:

100
100
71
71
-77
71
-71
81
-71
71
-71
77
77
-77
-71
-71
-71
-24
77
71
51
-71
22
71
71
77
77
-71
-71
23
71
-71
71
-7
77
-77
-50
71
77
64
-77
-71
71
71
71
77
77
-77
-42
-77
-77
71
71
-71
71
-71
71
77
56
-71
71
-77
71
71
-71
71
71
77
77
71
10
-71
71
71
71
77
-71
12
71
-77
-71
71
71
-71
-77
-71
-71
-71...

output:

21

result:

ok single line: '21'

Test #110:

score: 15
Accepted
time: 0ms
memory: 3720kb

input:

100
100
-45
-68
-7
-1
-82
-22
-89
-7
-20
-50
-38
-79
-9
-87
-11
-35
-61
-45
-24
-95
-43
-39
-81
-92
-62
-81
-70
-91
-7
-73
-45
-26
-22
-76
-27
-46
-51
-42
-17
-11
-11
-95
-50
-79
-18
-34
-56
-3
-21
-93
-71
-49
-51
-7
-75
-84
-65
-25
-17
-56
-43
-17
-88
-29
-44
-60
-41
-80
-78
-30
-78
-96
-46
-82
-31...

output:

0

result:

ok single line: '0'

Test #111:

score: 15
Accepted
time: 0ms
memory: 3940kb

input:

100
100
11
11
24
24
67
67
97
97
17
17
28
28
29
29
71
71
24
24
41
41
64
64
18
-70
18
10
10
24
24
52
52
7
7
87
87
85
85
89
89
69
76
69
13
21
21
45
45
2
2
-60
25
25
61
61
33
33
41
41
65
65
94
94
82
82
38
-79
24
38
-23
20
-3
20
17
17
73
73
47
47
90
90
65
65
7
7
98
98
57
57
15
15
8
16
8
14
14
88
88
50
50...

output:

45

result:

ok single line: '45'

Test #112:

score: 15
Accepted
time: 11ms
memory: 4632kb

input:

200000
200000
-163773
-113711
-57085
-23082
-7930
-67839
-93074
-94004
-8071
-3370
-144880
-181823
-121715
-19686
-44422
-53503
-23988
-136598
-137400
-152784
-172599
-159593
-17915
-86572
-168171
-4609
-10782
-160237
-81718
-140322
-164345
-184840
-143664
-23637
-106357
-36649
-48084
-63436
-77979
...

output:

0

result:

ok single line: '0'

Test #113:

score: 15
Accepted
time: 13ms
memory: 3976kb

input:

50000
200000
-24045
-11532
-38520
-43155
-16837
-19553
-36437
-37290
-29378
-12947
-3215
-23665
-18396
-32542
-26049
-4181
-243
-22857
-24435
-12419
-45137
-39454
-25150
-21610
-45515
-42391
-44640
-11179
-37683
-36784
-36261
-35822
-45764
-30652
-7627
-42561
-9669
-4697
-27085
-19487
-1206
-2388
-3...

output:

0

result:

ok single line: '0'

Test #114:

score: 15
Accepted
time: 13ms
memory: 4640kb

input:

200000
200000
1
2
-3
4
5
-6
7
-8
-9
10
-11
-12
-13
-14
-15
16
17
18
-19
20
21
22
-23
-24
-25
26
-27
-28
-29
30
-31
32
-33
34
-35
-36
37
38
39
40
-41
-42
-43
-44
-45
46
47
-48
49
50
-51
52
-53
54
55
56
57
58
-59
-60
-61
-62
63
64
65
-66
-67
68
-69
-70
71
72
73
74
-75
-76
77
-78
79
80
-81
82
83
-84
-8...

output:

0

result:

ok single line: '0'

Test #115:

score: 15
Accepted
time: 12ms
memory: 4100kb

input:

40000
200000
1
2
-3
-4
-5
-6
-7
8
-9
10
-11
-12
13
-14
15
-16
-17
18
-19
20
-21
-22
23
-24
-25
26
27
-28
-29
-30
-31
32
-33
-34
35
36
-37
-38
-39
40
-41
42
43
-44
-45
-46
-47
-48
49
-50
51
-52
-53
54
55
56
-57
58
-59
-60
-61
62
63
64
-65
-66
-67
-68
-69
-70
71
-72
-73
-74
-75
-76
77
78
-79
-80
-81
8...

output:

4

result:

ok single line: '4'

Test #116:

score: 15
Accepted
time: 12ms
memory: 4636kb

input:

200000
200000
57940
57940
150248
150248
51049
51049
101187
101187
73689
73689
79676
79676
22956
22956
30886
30886
105518
105518
89966
89966
85790
85790
178461
178461
63260
63260
186995
186995
84854
84854
20799
20799
152112
152112
163748
163748
53480
53480
101861
101861
3317
3317
170544
170544
11935
...

output:

99995

result:

ok single line: '99995'

Test #117:

score: 15
Accepted
time: 1ms
memory: 4532kb

input:

200000
1
-60566

output:

0

result:

ok single line: '0'

Test #118:

score: 15
Accepted
time: 10ms
memory: 3808kb

input:

3
200000
-1
2
-1
2
2
1
-1
-2
-2
-1
-1
2
1
2
2
-1
2
1
-1
2
-1
2
2
2
-1
2
1
-1
-1
-1
-2
1
-2
-2
-2
1
1
2
2
2
2
-2
-1
-1
1
2
-2
-2
-2
-2
-1
-2
2
1
-2
1
1
2
2
-1
2
-1
1
1
1
-1
-2
-1
1
1
2
-1
2
-1
1
-2
2
-2
-1
1
-1
2
-2
-2
1
-1
2
-1
2
1
1
-1
1
1
-1
-2
-2
1
1
2
-2
2
-2
-2
-1
-2
-1
-2
-2
-2
1
1
-2
1
2
-1
-...

output:

43109

result:

ok single line: '43109'

Test #119:

score: 15
Accepted
time: 6ms
memory: 3944kb

input:

4
200000
-1
-1
-2
3
-3
1
3
-2
-3
-2
2
-3
2
1
3
-1
3
1
1
3
-2
-1
2
-2
-3
-1
-2
-3
-3
2
-3
-1
-3
-3
3
-1
2
-3
-2
1
1
-2
-3
-2
-2
3
-1
3
-3
2
3
1
2
1
2
2
-2
1
1
-1
-1
2
2
2
3
-3
1
-1
-3
1
1
-3
-1
3
1
-3
3
3
1
3
-1
-1
2
-3
-2
-1
-1
2
-3
-1
-1
-1
-2
2
3
2
-1
-1
3
-1
-1
1
-3
3
-1
-2
-2
3
2
3
3
2
-1
2
1
-1...

output:

37984

result:

ok single line: '37984'

Test #120:

score: 15
Accepted
time: 10ms
memory: 3940kb

input:

10
200000
5
6
-6
6
-3
9
3
4
8
-5
5
4
1
-8
-3
-3
-5
-1
-1
-4
6
-7
-9
-8
-4
3
7
-6
9
2
4
-9
8
2
-4
-4
4
-6
5
-8
1
-2
2
7
9
2
-2
2
-8
8
-2
9
3
-3
-4
8
9
-6
6
-2
-3
8
7
-3
4
4
-5
2
6
3
7
7
-8
-3
4
6
2
9
5
-5
-1
-5
-4
2
9
1
-1
9
2
-9
7
6
-4
-7
-5
-4
-8
9
2
-9
2
-3
7
-7
8
-2
-2
-3
1
6
-9
1
8
8
-4
-2
7
5
7...

output:

24825

result:

ok single line: '24825'

Test #121:

score: 15
Accepted
time: 11ms
memory: 3880kb

input:

30
200000
23
-5
19
2
3
-21
-3
17
18
18
20
-16
17
2
19
-3
24
28
14
26
-26
11
-22
27
-18
-1
-11
-29
15
-27
-9
28
-29
-21
-10
29
-24
-14
-4
-3
-12
29
11
5
12
-1
6
-21
22
-6
22
-12
1
-2
-29
-23
16
-27
-22
-24
17
9
-17
-4
-26
-12
3
-28
-18
-11
-8
29
-4
-15
-9
-6
6
-27
-28
4
-12
-25
18
7
-16
13
26
23
4
2
...

output:

14590

result:

ok single line: '14590'

Test #122:

score: 15
Accepted
time: 11ms
memory: 3940kb

input:

203
200000
87
-195
-133
24
-53
40
-76
-189
164
-59
-116
186
43
138
40
102
-28
-66
71
-48
-156
128
-33
-110
-116
-115
-159
56
194
-169
161
-181
-5
-62
120
-149
-48
115
77
114
179
99
94
-198
-57
-184
47
80
-124
142
15
14
91
139
99
-156
-129
181
62
29
151
-190
-125
129
178
-60
158
-63
151
77
96
168
-16...

output:

5580

result:

ok single line: '5580'

Test #123:

score: 15
Accepted
time: 12ms
memory: 3796kb

input:

4000
200000
-2119
-3745
1740
-3302
-2388
1592
597
3135
1484
1293
-1921
-1577
-3325
1199
-2814
1529
1439
1372
-2115
-415
-2709
2674
-2206
1469
813
1291
-120
-556
-2440
-3943
2235
3870
-2484
-2142
-789
-3029
-2927
-2619
-3385
1236
-2123
2046
-3474
-532
1544
1312
3644
2176
2935
3770
2225
3312
1160
-233...

output:

1248

result:

ok single line: '1248'

Test #124:

score: 15
Accepted
time: 13ms
memory: 4132kb

input:

50000
200000
3123
-18156
-42443
18615
-35382
13959
25127
32144
36434
-23918
46826
26045
5073
-21870
39978
3749
41174
39532
42661
-23809
14504
-28909
-40797
-46359
2149
-34737
-7737
-22027
81
23834
-23655
16387
-31788
-8093
49682
-38618
-7282
-45550
41481
-40876
-33239
33495
-23477
-48631
24381
3125
...

output:

344

result:

ok single line: '344'

Test #125:

score: 15
Accepted
time: 14ms
memory: 4532kb

input:

200000
200000
116895
138667
-104683
-194965
-36899
-137103
-101529
-160480
-76572
63847
54219
-62523
-71971
67379
-199305
-14248
60875
118029
33603
149129
78564
-140379
-30454
-113201
136310
-165976
-41016
-153444
142460
-103746
139253
-153944
61520
146146
172356
-73992
-12224
129804
-152167
90298
-...

output:

177

result:

ok single line: '177'

Test #126:

score: 15
Accepted
time: 14ms
memory: 4664kb

input:

200000
200000
63552
-73987
133593
-128658
-149182
100711
-40040
-174163
-57073
144237
-140413
117569
-22208
-104003
-111148
189942
175232
88024
-177157
-193405
53619
-139771
156048
184098
-173915
-107602
184274
-195589
-71605
155671
-149211
-94647
112634
43528
171217
35156
34893
63083
-29568
58577
-...

output:

174

result:

ok single line: '174'

Test #127:

score: 15
Accepted
time: 15ms
memory: 4636kb

input:

200000
200000
-42057
66020
44097
134933
10324
110929
-123581
12071
-171072
-136502
-186705
-83413
2114
26068
-144023
44690
-114837
-128012
-8759
90312
-81042
-133215
-144149
25007
-809
-155906
113740
51427
183145
190916
-71876
117599
20778
-180590
145886
-155318
164786
-111747
106096
167882
-52140
-...

output:

184

result:

ok single line: '184'

Test #128:

score: 15
Accepted
time: 14ms
memory: 4644kb

input:

200000
200000
44549
-44549
44549
-157930
44549
157930
-157930
44549
-44549
-44549
44549
-32382
-157930
32382
32382
-157930
-44549
-157930
-44549
32382
-32382
44549
-32382
-32382
-32382
-157930
157930
-44549
-44549
157930
157930
-44549
-157930
-44549
-60333
-157930
157930
119043
-157930
157930
-15793...

output:

34287

result:

ok single line: '34287'

Test #129:

score: 15
Accepted
time: 10ms
memory: 4656kb

input:

200000
200000
-135532
-68903
-131722
-147513
-14355
-6073
-23866
-92197
-104186
-22134
-81992
-27489
-18167
-31662
-118948
-188178
-16479
-43545
-122052
-94331
-132104
-182571
-161111
-160003
-190033
-117095
-76090
-172452
-177789
-184768
-80544
-91275
-48584
-70910
-69984
-84657
-164902
-84380
-674...

output:

0

result:

ok single line: '0'

Test #130:

score: 15
Accepted
time: 0ms
memory: 3860kb

input:

4
5
-2
2
1
-3
2

output:

1

result:

ok single line: '1'

Test #131:

score: 15
Accepted
time: 1ms
memory: 3844kb

input:

2
4
1
1
1
1

output:

3

result:

ok single line: '3'

Test #132:

score: 15
Accepted
time: 0ms
memory: 3796kb

input:

2
5
1
-1
1
-1
-1

output:

0

result:

ok single line: '0'

Test #133:

score: 15
Accepted
time: 1ms
memory: 4636kb

input:

200000
7
199999
199999
1
199999
55
199999
55

output:

3

result:

ok single line: '3'

Test #134:

score: 15
Accepted
time: 0ms
memory: 3872kb

input:

3
6
1
2
2
2
1
1

output:

3

result:

ok single line: '3'

Extra Test:

score: 0
Extra Test Passed