QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#399584#4245. Equal MEXmonstersqwqAC ✓35ms9576kbC++202.7kb2024-04-26 15:28:072024-04-26 15:28:08

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3668kb

input:

4
6
0 0 0 1 1 1
5
0 1 0 1 0
4
0 0 0 0
3
3 3 3

output:

1
3
8
4

result:

ok 4 number(s): "1 3 8 4"

Test #2:

score: 0
Accepted
time: 35ms
memory: 3616kb

input:

300000
1
1
1
1
1
1
1
1
1
1
1
0
1
0
1
0
1
0
1
0
1
1
1
0
1
1
1
1
1
0
1
1
1
0
1
1
1
0
1
0
1
1
1
1
1
1
1
1
1
0
1
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
1
0
1
0
1
0
1
0
1
0
1
0
1
1
1
0
1
1
1
1
1
1
1
0
1
0
1
1
1
1
1
0
1
1
1
0
1
0
1
1
1
1
1
1
1
0
1...

output:

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 300000 numbers

Test #3:

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

input:

100000
3
2 2 0
3
0 1 3
3
1 1 3
3
0 1 0
3
3 2 2
3
2 2 1
3
1 3 1
3
0 2 0
3
3 2 2
3
2 0 3
3
3 2 0
3
3 2 1
3
0 3 0
3
2 0 1
3
3 3 3
3
2 3 0
3
0 2 2
3
0 1 1
3
0 1 1
3
0 3 2
3
2 1 0
3
3 2 0
3
0 1 2
3
3 3 1
3
0 3 1
3
0 3 2
3
0 3 1
3
2 3 0
3
0 2 3
3
2 1 2
3
0 3 2
3
3 2 3
3
3 2 0
3
1 3 1
3
3 2 2
3
0 2 2
3
3 2...

output:

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

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 17ms
memory: 3756kb

input:

100000
4
4 0 0 2
3
1 3 0
4
0 3 1 2
3
0 0 2
3
0 3 2
4
0 1 2 1
3
1 1 3
2
2 0
3
3 3 3
2
2 2
3
2 3 2
2
2 2
2
1 0
3
0 1 3
3
2 0 2
3
3 1 0
4
1 2 2 4
2
0 2
4
0 4 0 1
3
1 0 1
4
0 1 3 0
3
3 1 3
2
0 2
4
0 4 3 2
2
0 0
4
1 2 3 4
4
4 0 2 0
2
1 2
4
0 3 2 2
3
2 3 2
3
2 1 0
3
2 0 2
2
1 1
3
0 0 1
4
3 1 4 4
4
4 3 0 0...

output:

2
1
1
2
1
1
4
1
4
2
4
2
1
1
1
1
8
1
1
1
1
4
1
1
2
8
3
2
1
4
1
1
2
1
8
2
1
4
1
1
1
4
2
1
8
4
2
4
1
8
8
2
1
1
4
8
1
1
2
1
8
1
1
6
4
1
8
1
1
1
8
8
8
1
1
4
1
4
1
2
1
4
1
2
8
1
4
1
4
1
1
1
4
1
6
8
8
8
4
8
4
1
4
1
1
1
1
2
1
2
4
8
8
2
1
4
1
1
8
1
1
1
8
1
4
8
2
1
4
4
1
3
4
2
1
2
1
2
2
4
4
1
8
8
4
8
4
1
4
1
...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 14ms
memory: 3628kb

input:

10000
37
35 7 2 6 0 22 35 8 32 24 16 25 15 27 35 14 8 20 8 0 27 29 35 10 25 34 2 11 35 37 23 25 3 25 31 32 36
35
13 15 18 28 28 12 26 22 30 34 11 23 3 22 29 30 22 15 3 1 28 29 34 24 9 30 15 23 29 21 26 5 16 31 14
20
4 2 6 14 13 5 18 1 0 18 8 1 14 13 11 11 2 12 10 4
34
32 32 25 33 19 30 16 27 6 29 28...

output:

16
209715183
1
603979768
16
10
67108864
1048576
1
1
1
1
21
1
209715183
1
2097152
1
4194304
16
1048576
10
67108864
301989884
1
1
1
4194304
268435456
1
1
1
1
1
134217728
1
1
1
360709869
1
1
1
16777216
1
1
1
603979768
1
16777216
1
33554432
75497471
536870912
536870912
1
1
1
1
10
1
1
1
209715183
7549747...

result:

ok 10000 numbers

Test #6:

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

input:

10000
26
14 19 19 26 24 18 24 26 16 2 6 7 17 18 25 8 15 2 2 9 22 13 12 15 5 1
29
7 17 23 8 14 18 17 3 11 4 24 16 0 20 8 19 8 6 18 8 24 4 20 8 28 5 11 5 2
40
21 39 36 32 40 12 34 28 8 12 2 16 23 12 28 20 18 29 34 28 16 6 4 22 30 22 36 40 13 39 25 20 23 34 38 29 40 2 11 0
32
14 11 13 9 6 14 4 3 5 13 2...

output:

33554432
1
1
1
1
360709869
301989884
1
1
1
1
67108864
1
1
8388608
1
838860732
268435456
1
1
419430366
44
396
16777216
134217728
1
1
1
838860732
12
13
1
8
419430366
1
134217728
11
1
301989884
1
1
72
8388608
1
1
1
1
1
1
1
1
209715183
1
524288
1048576
4194304
1
91
1
1
24
1
1
17
134217728
1
67108864
134...

result:

ok 10000 numbers

Test #7:

score: 0
Accepted
time: 13ms
memory: 3680kb

input:

1000
370
32 23 10 9 6 3 36 8 20 37 1 9 1 32 34 7 11 22 4 35 26 27 34 37 8 16 5 14 36 20 22 12 10 27 37 5 17 33 5 23 24 25 3 12 10 21 7 19 0 12 5 20 20 23 10 15 9 1 10 0 6 28 12 22 4 16 22 33 4 21 15 13 16 21 9 27 28 29 30 19 22 18 12 0 11 2 13 21 33 34 26 30 2 24 4 9 9 31 0 15 34 21 2 20 28 32 28 32...

output:

54
1
1
1
51
1
123568631
1
26
1
1
1
32
1
1
1
1
864970212
1
1
1
1
36
1
1
1
123568631
1
1
1
1
66
183252900
65
384960822
1
78
1
1
595
1
129
1
87
11
1
187
1
1
284617744
974353740
644
1
304933431
1
1
44
105
1
1
651588892
886
1
1
1
1
1
1
69
1
1
40
617122664
1
1
290285394
92
1
1
114
1
1
1
1
1
1
1
1
1
34
836...

result:

ok 1000 numbers

Test #8:

score: 0
Accepted
time: 13ms
memory: 3692kb

input:

1000
305
0 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
241
71
1
384960822
1
1
48484
1
1
1
38
1
102108225
28
1105
1
31
24
12255
1
2256
1
1
1
145142697
1
1
789180938
1
1
1
142308872
69
1
179
1
1
1
871713543
1
1
1
1
59
1
1
23
1
1
1
8
1
103
1
28
1
1
1
52
1
31
747497717
13625
1
1
871713543
1
1
58
1
17
1
1
1167
72
1
225123532
1
1
1
1
53
43
136
35
67
46
1
1
...

result:

ok 1000 numbers

Test #9:

score: 0
Accepted
time: 10ms
memory: 3664kb

input:

1000
387
10 353 378 43 76 15 43 14 34 14 71 6 54 50 315 90 15 20 77 60 31 94 42 32 85 87 15 57 17 24 75 49 60 29 51 45 95 53 56 182 80 37 82 65 68 81 5 57 64 85 2 6 103 54 31 47 88 92 85 384 15 27 28 79 74 66 48 254 28 4 18 2 46 15 18 18 91 66 3 274 84 96 59 58 9 94 48 30 91 24 54 76 0 167 91 86 59 ...

output:

1
1
1
284617744
1
1
1
1
1
1
1
21
97
875687385
1
1
1
1
1
1
84720
1
4
1
1
1
1
467888
2054562
733011600
146088
1
522053
18
1039835
1
1
1
1
85299
1
1
369288
1
1
1
129377
1
66754
1
1
8209
1
383068
1
1
117
14968
66654
104037
1
1
1
1
1
67
170
294049
1
879190462
406183
251655
1
1
1
169846
1
25062
6080
21553...

result:

ok 1000 numbers

Test #10:

score: 0
Accepted
time: 10ms
memory: 3704kb

input:

1000
201
3 1 4 1 0 4 3 2 5 4 4 0 0 4 4 2 5 3 1 3 3 2 1 1 138 2 5 0 157 2 85 2 5 5 2 2 34 2 2 1 87 1 1 3 5 5 5 2 3 3 1 0 2 35 4 2 3 3 17 0 5 4 162 2 2 2 5 0 3 4 3 2 79 4 1 2 1 5 2 3 1 4 5 4 4 5 5 1 0 5 130 3 3 5 3 1 2 166 4 3 3 3 1 111 2 1 4 1 0 0 2 2 2 4 5 1 3 1 2 1 67 3 1 2 4 2 3 32 2 2 5 4 1 4 0 2...

output:

813795222
71
29487181
42
1
678477934
1
67
78
1
1
54
98540138
267977539
415888567
1
1
1
437781523
1
68
139
1
58
1
259884202
40
50
1
19
1
1
1
39
197265428
58
27
53
38
1
1
1
1
42
224126303
859340294
1091
605912055
52
690939632
1
64
97
403584878
217
1
146
1
26
1
1
1
1
10
20
1
5
37
177731785
1
82
67
1
50...

result:

ok 1000 numbers

Test #11:

score: 0
Accepted
time: 13ms
memory: 3680kb

input:

1000
263
9 5 3 2 18 4 8 12 7 19 4 3 9 5 2 2 15 5 6 8 0 175 16 10 6 15 1 1 24 17 10 12 4 0 6 16 11 7 2 6 5 12 1 5 2 0 3 0 1 0 20 2 21 6 11 9 0 1 0 256 6 7 17 24 10 15 0 13 150 19 2 8 5 1 9 0 0 11 2 1 13 22 0 19 9 11 3 18 5 10 0 3 7 3 3 0 2 8 10 0 14 17 3 4 0 12 0 8 228 6 259 2 21 5 247 174 8 8 1 2 6 ...

output:

1
1
1
97
48058
1
1591
1
1
12640
1
56566021
1
1
1
1
79530
1
1
1
1
1
1
47
1
1
1
455504
1
243381
3019
6640
1
1
1
1
4
1
1
1
1
1
1
1
1
186
1
1
1
1
5
1
44748
54
1
1
1
1
1
12844
58495
1
1
1
1
1
1
3231
1
1
1
1
1
168424
1
1
1
1
341
1
1
1
1
1
1
3
91
2145
1
1
588102
1
1
405692
1
1
1
1
1
1
158
1
1
1
1
18580
103...

result:

ok 1000 numbers

Test #12:

score: 0
Accepted
time: 13ms
memory: 3604kb

input:

1000
252
2 1 3 1 1 0 0 197 0 1 2 1 1 0 0 3 0 1 4 1 1 2 0 0 3 0 0 0 3 0 0 2 0 0 2 0 1 239 1 1 1 0 0 0 0 71 0 0 0 2 1 1 0 0 4 0 0 0 0 0 0 1 0 184 0 3 0 0 0 0 2 0 0 0 0 2 0 0 213 0 1 0 1 3 0 0 0 3 0 0 0 0 3 0 1 1 2 0 0 0 0 1 1 1 2 0 1 6 2 2 0 1 0 0 0 0 0 4 0 0 2 2 0 1 3 3 0 0 0 86 1 0 1 1 0 0 0 2 0 0 2...

output:

11
1
684376657
1
1
119
1
1
1
1
1
7352
78
56
1
47
1
1
31
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
4
4968
1
1
1
23
56
9
1
1
1
2
1
1
1
1
8
1
1
1
1
78
1
1
1
59
1
1
1
1
52316
1
1
1
21
1
1
74
1
1246
1
1
1
1
69
1
1
1
1
1
10
1
1
1
1
1
1
1
1
1
37
1
1
1
1646
12
1
1
26653092
158
1
1
1
1
1542
1
1
1
1
1
1
1
364...

result:

ok 1000 numbers

Test #13:

score: 0
Accepted
time: 14ms
memory: 3736kb

input:

100
3000
42 107 10 31 8 0 46 28 68 22 67 41 101 7 9 23 2 22 5 6 21 55 4 0 110 138 64 3 2 28 114 8 1 107 999 6 5 62 6 8 17 2 2 15 8 44 48 11 147 3 3 8 2 75 4 100 6 2 50 82 18 96 2926 2 49 2 46 77 19 1602 63 34 1 10 2450 3 107 54 17 5 1 20 233 68 11 26 8 74 3 59 1 118 12 29 1 32 97 19 22 20 182 4 3 18...

output:

1
1
1
1
1
1
1
514
1137
1
1
1
1
198
1
1
1
1
1
1
1
1
709
1
1
1
1
358
1
1
1
1
359
1
1
1
1
1
1
1
1
1
1
18868
1
300
1
1
1
1
1
247
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
447
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
157
1
1
1
1
1
1

result:

ok 100 numbers

Test #14:

score: 0
Accepted
time: 13ms
memory: 3672kb

input:

100
3000
3 2 3 5 6 12 17 0 50 1029 18 8 51 18 9 22 16 5 21 91 10 33 1 7 27 50 8 52 33 3 14 1 0 30 12 16 18 37 2 1314 6 7 2 11 8 1 67 8 11 10 7 15 0 7 59 30 3 14 45 0 79 6 0 9 10 959 0 10 6 46 14 43 10 2 12 0 72 8 1 41 0 9 19 69 0 6 39 619 107 0 189 5 64 1 655 31 13 18 81 43 5 25 15 25 7 15 3 3 4 27 ...

output:

1
288888566
163394838
1
1
35
1
1
1
1
474
1
1
1
1
84057
1
1
1
375
1
1
873
1
1
1
147
1
1
1
742
1
1
1
1
402444522
1
1
1
1
913439926
1
414832030
945
1
1
1
339
1
1
1
1
1
365
133495706
1026
1
1
1
1
913501955
1
1
1
35378
1
1
1
1
1
102017789
1
1
1
1
1
44237790
1
1
1
436
1
1
1
126447915
816
1
1
1
1216742
1
1...

result:

ok 100 numbers

Test #15:

score: 0
Accepted
time: 8ms
memory: 3932kb

input:

30
10000
0 0 0 0 0 0 0 0 0 0 5 616 0 0 0 0 0 0 1 0 1 0 0 0 6435 0 0 3 0 0 1 0 0 0 3 0 0 0 0 0 0 0 0 0 0 1 1 0 2 0 0 0 3 0 1 0 0 0 0 2 0 0 4907 0 0 0 0 0 0 0 2 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 3 2 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 6345 0 0 0 0 ...

output:

769732
755300195
127295790
1
477864078
217992243
44391460
901532
990045694
1
1
645727465
626975
1
1
1
1
1
1
805445251
447086053
1
680
2738591
987252010
574124713
1
1
321211034
788302854

result:

ok 30 numbers

Test #16:

score: 0
Accepted
time: 12ms
memory: 3836kb

input:

30
10000
0 0 9137 1739 0 0 0 1 0 0 0 0 0 469 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8116 1 3622 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6689 0 1696 0 0 0 0 0 0 0 0 0 0 5118 0 0 0 0 2092 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 2271 0 0 9214 0 0 0 0 0 0 0 0...

output:

428329193
1
823163947
1
708159412
528033435
1
85434600
2024
802383283
1
1
1
12110007
1
1839047
822
409382987
1
1085
933885647
1
656547526
1
1
3072
755700996
403542615
1
1

result:

ok 30 numbers

Test #17:

score: 0
Accepted
time: 11ms
memory: 5672kb

input:

3
100000
21 5 4 14 31971 7 23 3 2 0 31 1 4 7 0 6 31 0 13 7 27 8 52 10 10 6 0 0 57 12 9 4 3 14 3 22 1 2 14 4 35 22 1 10 0 23 4 7 6 2 39 15398 3 0 5 5 29065 21 27 7 0 0 5 4 37 0 6 57 53 3 24 5 83656 32 6 0 45 8 0 29 60 2 0 2 0 8 9 7 13 5 63877 2 3 1 0 0 4 18 88369 4 4 3 3 22 4 22 4 25 9 0 0 10 2 0 1 4...

output:

1
1
1

result:

ok 3 number(s): "1 1 1"

Test #18:

score: 0
Accepted
time: 14ms
memory: 5556kb

input:

3
100000
9 0 0 3 0 0 0 1 0 8 0 2 2 0 7 66015 0 2 13 0 1 0 4 0 0 3 2 0 2 0 31 0 0 0 0 1 0 78443 6 2 3 5 2 1 1 1 1 3 0 1 4 0 3 0 0 0 3 0 3 4 1 3 11 4 5 0 27 12 20 0 9 0 1 0 4 22 0 2 1 2 0 0 4 9 4 0 0 2 2 7 0 0 0 0 9 0 2 0 2 0 0 3 0 3 0 1 13 15 0 1 0 4 3 3 0 3 3 2 2 12216 12740 41915 1 0 1 0 1 15050 0 ...

output:

1
1
1

result:

ok 3 number(s): "1 1 1"

Test #19:

score: 0
Accepted
time: 14ms
memory: 5632kb

input:

3
100000
22 0 3 6 0 11 25 2 0 3 38 13 12 3 3 1 57720 0 1 0 3 1 80976 2 0 12 2 7 1 2 0 1 0 1 0 7 0 0 1 17 30 6 2 2 0 10 0 3 0 11 9 5 3 26 2 6 2 17 90876 1 76988 0 0 2 3 0 2 16 7 0 0 0 36 0 18 6 2 2 4 13 4 68 0 1 20 0 8 2 0 0 1 2 17 23 1 28 8 6 0 3 28 3 59371 11 0 10527 6 1 9 3 36 7 6 2 72819 5 3 1 7 ...

output:

1
1
1

result:

ok 3 number(s): "1 1 1"

Test #20:

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

input:

3
100000
14 2 0 23 62479 0 13 2 3 1 0 0 0 0 1 5 2 0 4 0 0 0 2 1 0 1 0 0 0 0 2 9 0 3 8 73163 0 2 3 0 1 0 0 0 0 2 5 0 0 2 3 0 0 0 0 2 20 6 0 1 1 9 1 0 1 3 3 13081 2 2 9 2 0 2 7 6 1 2 17 0 2 4 2 7 0 7 0 1 35755 0 7 0 0 1 0 0 4 0 0 0 0 2 45620 0 0 0 4 38 1 0 1 1 1 0 12 0 1 0 0 13 2 0 2 3 0 2 30 0 2 0 0 ...

output:

1
1
1

result:

ok 3 number(s): "1 1 1"

Test #21:

score: 0
Accepted
time: 14ms
memory: 5528kb

input:

3
100000
6 70 73 0 0 256 21 37 0 4 104 0 94488 29 41 14 5 108 31 297 54 68 43731 45926 0 2 177 21 0 19 37 71 2 9 65 42 33 0 2 28 53 1 2 201 0 4 8 2 253 60 6 27 7 0 40 2 36 1 21 44 1 90 32 35 68 48 57 0 0 32 38 0 12327 15 7 16 16 59 0 59 35 3 193 0 20 17 371 68 46 0 1 8 1 2 0 65 4 0 0 1 1 26 175 0 14...

output:

1
1
13658

result:

ok 3 number(s): "1 1 13658"

Test #22:

score: 0
Accepted
time: 14ms
memory: 5560kb

input:

3
100000
19 8 3 2 0 2 30 33 12756 29 17 9 16 1 0 4 0 4 0 0 49 1 0 6 2 6 1 11 7 0 22860 8 4 0 0 1 0 3 1 1 0 1 0 4 2 7 8478 3 3 10 0 35 1 0 2 0 6 12 1 19 27 2 2 3 0 0 0 0 2 23 2 1 14 12 0 3 25 5 0 14 1 14 7 0 0 4 0 48524 0 0 0 2 4 1 2 9 20 36 87141 10 4 0 6 0 2 0 31 9 26 0 0 0 0 2 54 18 0 2 10 7 10 19...

output:

1
1
1

result:

ok 3 number(s): "1 1 1"

Test #23:

score: 0
Accepted
time: 14ms
memory: 5624kb

input:

3
100000
0 3 0 0 0 0 2 0 59415 0 25952 37666 0 82031 0 0 0 58430 0 2 0 2 6 0 0 5 0 0 0 0 0 1 0 0 0 0 1 0 2 0 0 0 13 2 0 0 1 1 1 0 3 0 0 0 2 2 0 2 46905 0 0 0 0 1 1 3 0 5 0 0 0 0 64445 9 0 0 0 2 0 0 0 0 2 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 67762 1 2 0 0 3 4 1 0 0 1 0 1 0 0 2 2 0 1 2 4 0 0 0 0 0 0 0 0 ...

output:

114814378
31721
1

result:

ok 3 number(s): "114814378 31721 1"

Test #24:

score: 0
Accepted
time: 14ms
memory: 5684kb

input:

3
100000
85662 7 4 110 2 1 0 0 1 12 5 14736 14 2 144 3 5 81 1 280 1 5 2 7 154 35 1 35 0 2 3 0 0 122 16 8 75 4 2 8 4 160 25 11 0 26423 2 13 9 146 69 84667 79 0 64 1 85 4 83 23 60 4 3 15 57 172 33 13 6551 118 11 31 25 8 2 149 33 98 2 0 2 0 0 5 15 14 4 4 0 49 36 27 46 11 14 42 9 11 46 56333 33 1 0 1 2 ...

output:

1
1
1

result:

ok 3 number(s): "1 1 1"

Test #25:

score: 0
Accepted
time: 11ms
memory: 5692kb

input:

3
100000
0 4 3 6 0 0 3 0 3 0 66730 0 1 1 0 1 2 1 2 0 24 0 12 2 0 5 2 2 1 4 18 1 25 23 3 0 4 0 2 30 5 7 0 10 2 4 0 14 36412 0 0 9 1 0 7 1 0 19 5 0 0 5 7 3 0 0 0 0 26 1 10 0 0 38 0 48656 6 3 20 19 0 2 25 4 43 27 1 13 2 41 4 0 18 0 10 0 64 3 5 3 38 20 13 23544 2 3 0 0 15 8 1 14 52 12 2 20 9 1 6 3 13 8 ...

output:

1
1
1

result:

ok 3 number(s): "1 1 1"

Test #26:

score: 0
Accepted
time: 14ms
memory: 5632kb

input:

3
100000
76417 1 0 7 0 3 0 7 6 6 0 1 6 2 1491 16 0 0 8 1 2 6 1 0 7 4 4 2 8 0 3 3 0 0 0 1 0 19 4 0 9 4 0 1 1 0 0 91125 0 77138 1 6 1 2 3 4 0 4 2 3 4 7 5 4 0 1 0 0 1 2 0 0 2 0 0 2 1 4 0 0 0 3 1 3 3 0 3 3 7 4 0 3 0 2 0 11 0 1 0 4 3 6 2 0 9 0 0 2 2 2 0 4 0 11 0 1 2 2 1 7 0 1 1 1 0 3 0 2 1 24110 0 4 3 2 ...

output:

64879214
12761
1

result:

ok 3 number(s): "64879214 12761 1"

Test #27:

score: 0
Accepted
time: 14ms
memory: 9452kb

input:

1
300000
0 24 35 5 70 3 88935 3 955 0 87 275 8 1 22 16 82 138 32 8 1 15 53 19 1 277 109 3 3 75029 23 14 93 41 1 1 0 6 77437 15 373 6 12 16 13 3 16 187 7 1 43 21 81 120 32 9 27 0 22 93 279 1 301 0 137350 0 112 188 165 362 37 17 79 7 28 4 868 33 3 3 3 86354 105 11 0 2 332 0 35 3 18 10 160 159 23 24 1 ...

output:

1

result:

ok 1 number(s): "1"

Test #28:

score: 0
Accepted
time: 8ms
memory: 9516kb

input:

1
300000
1 36 21 19 0 11 4 16 2 8 8 5 0 31 10 21 0 1 2 7 4 1 0 11 16 0 7 5 2 21340 7 9 2 35 21 0 84942 5 253376 10 1 30 0 10 0 10 13 87876 2 0 23 0 36 19 14 2 2 13 10 25 2 6 6 7 0 11 0 6 7 4 1 4 18 1 21 8 0 5 0 8 3 154478 9 5 4 9 1 240712 1 3 3 0 0 2 0 5 0 1 14 1 33 3 19 1 2 8 7 1 5 244627 5 0 4 1 1...

output:

5033724

result:

ok 1 number(s): "5033724"

Test #29:

score: 0
Accepted
time: 4ms
memory: 9452kb

input:

1
300000
38 1 7 15 1 2 27 0 44 5 7 0 3 116 22 7 17 0 4 8 27 0 3 4 12 2 15 3 0 40 0 4 50 37 0 1 4 18 74 30 157 47 1 11 115916 91 22 2 20 25 1 201705 18 16 1 19 1 1 0 9 0 4 23 14 0 11 1 13 1 1 89048 0 68 15 23 0 1 23 11 1 207208 67 17 0 2 2 17 4 12 10 26 6 19 43381 55 1 25 2 0 5 21 0 4 7 1 1 0 2 0 86 ...

output:

1

result:

ok 1 number(s): "1"

Test #30:

score: 0
Accepted
time: 7ms
memory: 9504kb

input:

1
300000
288945 1 42 9 29 108 49 3 10 4 34 88 55 24 30 1 107 42 1 52 188 64 44 26 2 8 5 11 3 48 41 16 82 3 54 69 4 95 99 39 49 2 26 1 15 35 1 16 19 35 1 9 145567 14 5 4 63 29 103 131 4 34099 134 256467 22 18 100 0 18 20 85 7 31 63 0 22 1 1 14 120 2 264946 33 1 130 64 1 1 52 74 1 59 9 25 2 63 88 4 20...

output:

1

result:

ok 1 number(s): "1"

Test #31:

score: 0
Accepted
time: 11ms
memory: 9484kb

input:

1
300000
20 2 4 99860 0 5 2 1 1 0 13 19557 0 6 25 24 2 1 9 8 1 0 13 2 46 0 44804 10 5 1 10 1 26 13 1 12 1 0 18 0 6 1 22 2 13 13 4 7 0 22 103845 43 1 25 12 0 22 81686 1 11 0 15 0 0 14 10 2 18 13 5 0 6 12 1 5 9 2 4 0 1 3 5 3 1 3 0 0 0 8 5 15 0 13 15 3 10 10 18 0 2 37 15 1 0 197087 24 1 0 22 2 12 1 6 2...

output:

901779177

result:

ok 1 number(s): "901779177"

Test #32:

score: 0
Accepted
time: 17ms
memory: 9516kb

input:

1
300000
36 4 1 49 160 111 0 51 36 6 25 18 15 0 0 1 36 7 1 11 7 0 52 0 21 3 117740 3 21 14 75 4 1 3 7 12 73 119 14 7 5 152 14 4 88 30 149 48 14 9 33 3 40 60 76 61882 58 44 91 38 24 30 0 28 29 108784 110 1 5 13 13 5 9 16 30 185 3 17 286698 39 0 14 1 39 37 1 18 202 40 0 16 2 261656 69 6 66 105 116 15 ...

output:

1

result:

ok 1 number(s): "1"

Test #33:

score: 0
Accepted
time: 16ms
memory: 9516kb

input:

1
300000
4 4 4 0 12 4 3 14 10 5 4 6 15 12 31 0 108887 9 1 9 8 19 0 18 1 26 0 3 1 3 6 1 3 8 1 13 0 6 2 3 3 2 5 0 5 22 128135 5 3 34 30 19 2 1 0 0 0 8 1 9 10 5 2 38 2 1 1 0 3 13 0 6 3 9 0 9 1 3 4 1 3 27 0 0 8 3 4 0 5 1 15 4 21 25 22 14 2 5 3 4 0 5 0 34 3 5 0 4 13 2 19 2 10 5 14 0 4 2 1 1 5 3 6 0 4 984...

output:

1

result:

ok 1 number(s): "1"

Test #34:

score: 0
Accepted
time: 12ms
memory: 9456kb

input:

1
300000
9 55 21 37 92273 4 163279 4 37 6 2 34 18 3 113 20 15 57 62 43 10 19 0 28 1 11 17 12 2 1 7 295659 21 12 4 4 15 1 36 6 19 4 1 0 13 24 6 16 0 30 91 78 62 4 24 20 3 25 22 2 15 4 30 5 8 2 79 144161 12 27 0 28 15 3 1 15 11 1 23 0 4 8 40 2 10 0 0 42 25 2 160 0 58 7 8 35 0 73 58 19 11 3 109 5 2 6 0...

output:

80312

result:

ok 1 number(s): "80312"

Test #35:

score: 0
Accepted
time: 16ms
memory: 9448kb

input:

1
300000
3 3 27 22 0 6 96 10 13 41576 96 6 15 30 28014 101 88310 13298 62 26 15 41 0 153 82 48 55 16 6 15 1 24 11 1 28 51 44 6 2 57 1 2 1 15 221687 0 1 70 66 1 103 27277 23 127836 98 29 9 5 85 20 11 50 30 26 168 0 10 50 4 2 23 121 76 0 25 41 58 101 7 3 263993 10 28 84 57 6 67 2 35 9 68 188 25 2 86 3...

output:

1

result:

ok 1 number(s): "1"

Test #36:

score: 0
Accepted
time: 12ms
memory: 9516kb

input:

1
300000
257655 2 0 0 1 3 0 1 2 0 1 1 6 7 0 286107 0 0 0 0 5 7 10 0 1 0 3 0 137101 206184 0 0 1 0 2 0 2 278250 10 6 0 0 0 0 0 0 6 1 0 0 1 1 0 3 1 2 0 0 0 0 31521 0 0 0 3 0 3 2 1 0 0 5 11 1 0 0 239566 0 0 0 6 0 5 4 7 2 0 0 1 0 0 3 0 2 2 0 0 0 1 0 7 5 0 3 0 0 0 0 3 3 2 0 0 0 0 8 1 0 0 0 117812 0 0 0 0...

output:

1

result:

ok 1 number(s): "1"

Test #37:

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

input:

1
300000
2 14 0 0 0 0 1 13 0 0 2 0 4 2 0 0 0 16 0 0 1 0 0 2 2 0 1 0 0 273828 0 22183 0 0 5 0 199092 0 1 1 0 3 0 0 0 0 3 0 254528 1 0 0 0 0 2 211458 1 0 2 0 27391 0 0 0 2 0 0 283745 6 8 0 1 0 0 0 1 1 0 141372 1 1 1 0 2 0 1 0 5 0 7 6 10 3 0 6 0 0 0 16 0 5 0 9 7 2 3 2 0 0 1 0 0 1 5 2 0 2 0 0 1 0 12 1 2...

output:

126770

result:

ok 1 number(s): "126770"

Test #38:

score: 0
Accepted
time: 17ms
memory: 9544kb

input:

1
300000
318 99 1 59 30 1099 206 461 96 39 3 74 73 13 12 343 62 3 55 2 97 110 39 8 47 39 10 261511 42 484 207 6 264 0 14 347 0 280 368 89 572 86 27 159 103 125 152 374 41 34 69 91 128 1964 207 180 50 78 4 14 121 4 91 209 838 6 19 1 1279 28 935 120 2 489 113 4 15 0 26 0 0 592 10 115 95 16 6 3 49 31 2...

output:

1

result:

ok 1 number(s): "1"

Test #39:

score: 0
Accepted
time: 12ms
memory: 9460kb

input:

1
300000
4 0 0 2 0 63 1 22 0 72 1 1 3 11 4 160110 2 2 3 2 0 27 22748 0 1 1 245868 0 1 0 24 20 19 2 35 16 3 19 23 3 4 0 0 0 57 16 0 0 2 0 0 8 23 46 1 5 4 19 11 0 17 38 30 116257 4 5 0 18 0 4 6 1 1 0 19 4 0 1 22 19 32 0 2 3 8 0 1 0 20 0 147946 4 24 0 7 1 1 0 41 0 0 16 41 0 25 33 2 0 64 9 41 0 2 0 0 0 ...

output:

1

result:

ok 1 number(s): "1"

Test #40:

score: 0
Accepted
time: 16ms
memory: 9576kb

input:

1
300000
4 0 1 6 0 0 3 0 0 8 0 6 0 3 0 1 2 5 230903 3 0 0 0 0 6 0 0 7 3 4 0 0 0 0 0 2 1 1 0 1 0 5 0 1 0 12 0 0 0 1 0 296689 1 1 1 2 0 1 0 1 0 1 31 0 2 0 5 2 0 0 0 8 1 110774 2 2 0 5 2 1 1 2 0 0 0 0 1 0 4 0 1 1 11 5 0 3 2 0 1 7 0 0 0 1 0 1 3 1 0 0 4 0 0 1 6 0 4 0 1 0 0 0 0 160943 0 8 0 0 1 0 2 0 1 0 ...

output:

1

result:

ok 1 number(s): "1"

Test #41:

score: 0
Accepted
time: 17ms
memory: 9512kb

input:

1
300000
168 125 91 13 1 0 11 44 236 5 40 14 6 12 32 8 1 457 63 10 195 377 1 73 32 104 39 209 14 2 13 0 1 44 106 200 327 1 40 308 0 11 55 2 138502 63 266909 88 84359 13 16 59 189 30562 6 517 64 84 637 525 237 1 270 80 4 201 163 0 42 79 1 57 89 129 9 22 230 11 220 1 174 241 52 29 17 42 1 192 204 96 3...

output:

1

result:

ok 1 number(s): "1"

Test #42:

score: 0
Accepted
time: 16ms
memory: 9496kb

input:

1
300000
3 12 18 2 30 4 84 14 8 1 33 1 5 1 24 2 42 9 34 0 1 9 4 5 8 14 82 293974 24 1 84 3 61 31 0 17 1 63 152116 5 9 1 3 134 3 2 225983 0 17 24 1 1 3 16 2 0 1 35 10 1 1 0 5 28 11 1 1 83 15 3 0 4 34 10 29 0 6 35 3 167897 21 0 35 17 26 35 13 0 31 6 38 3 26 10 4 23 1 6 13 4 0 5 0 13 3 138 6 0 57310 0 ...

output:

1

result:

ok 1 number(s): "1"

Test #43:

score: 0
Accepted
time: 12ms
memory: 9460kb

input:

1
300000
0 0 1 1 1 0 1 0 0 4 97256 0 1 213031 4 0 1 1 0 3 1 7 155675 5 4 1 5 4 0 0 0 4 6 0 0 0 0 0 1 0 1 1 0 0 0 11 6 0 0 0 1 0 5 0 0 1 3 3 107530 2 1 0 0 3 3 9 0 0 10 0 99480 3 2 7 0 0 1 0 0 1 5 0 4 0 0 1 1 0 8 0 1 0 2 7 2 1 3 2 4 225788 1 0 192396 0 5 7 1 0 3 5 4 0 0 0 1 3 0 0 0 0 1 0 0 0 0 0 0 1 ...

output:

1

result:

ok 1 number(s): "1"

Test #44:

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

input:

1
300000
0 0 1 1 14 1 1 1 2 3 1 4 4 10 1 19 4 0 5 0 52285 7 3 2 7 5 0 4 2 0 2 1 1 2 23 9 8 1 0 0 3 7 20 2 0 2 4 0 7 1 0 6 0 0 7 0 0 134510 0 7 3 8 4 79370 9 4 1 2 126207 0 1 1 0 12 7 4 224810 5 0 3 5 2 0 0 7 3 13 9 4 0 8 2 3 7 0 8 1 1 6 24 9 8 1 3 13 2 19 67594 7 0 5 0 0 1 15 1 0 1 5 15 0 4 5 4 0 0 ...

output:

641874911

result:

ok 1 number(s): "641874911"

Test #45:

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

input:

1
300000
0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 3 0 0 0 0 297625 0 0 1 1 1 2 0 0 0 125864 0 2 1 0 0 0 111992 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 1 3 0 0 0 0 178444 0 0 0 0 0 0 1 0 0 2 0 181927 31912 4 5 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1 0 88552 0 0 2 1 0 0 0 6 2 0 0 0 0 0 0 0 0 0 0 ...

output:

171949

result:

ok 1 number(s): "171949"

Test #46:

score: 0
Accepted
time: 11ms
memory: 9512kb

input:

1
300000
0 0 0 0 19985 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 4 0 42686 0 0 0 0 0 0 0 0 162966 0 0 0 0 0 0 0 0 0 0 0 60581 0 0 0 0 0 0 0 0 0 0 80125 1 0 0 0 249897 0 0 0 0 0 20966 0 245797 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 2 0 0 0 0 0 0 48878 0 0 0 200329 0 2 0 0 0 0 0 0 0 2 0 0 0 0 0...

output:

111193

result:

ok 1 number(s): "111193"

Test #47:

score: 0
Accepted
time: 7ms
memory: 9536kb

input:

1
300000
9 0 2 0 0 0 0 4 0 0 0 8 2 239474 0 0 0 0 0 0 1 1 0 7 0 2 33573 0 2 2 0 0 0 2 2 0 0 2 3 1 0 0 2 0 5 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 9 2 1 1 0 2 2 0 0 0 14 0 1 7 1 2 0 0 0 49411 171825 5 0 0 2 0 5 0 2 2 0 42761 1 0 0 0 0 0 1 0 0 0 0 2 0 0 0 0 0 1 0 0 0 0 188850 1 0 0 0 0 2 2 0 1 0 2...

output:

1

result:

ok 1 number(s): "1"

Test #48:

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

input:

1
300000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 2 2 0 3 0 0 0 0 0 0 0 0 1 0 13856 0 0 0 0 0 2 0 0 0 0 0 0 0 139699 0 0 243986 0 0 0 33767 0 1 0 0 0 3 0 0 0 1 0 3 0 0 18 0 0 0 0 0 0 0 0 0 0 73654 0 0 0 3 0 0 0 0 0 0 0 0 0 1 0 0 144375 0 2 0 0 0 0 0 0 0 0 0 0 0 0 40403 1 0 0 2 4 0 0 0 0 0 19363...

output:

1

result:

ok 1 number(s): "1"

Test #49:

score: 0
Accepted
time: 8ms
memory: 9516kb

input:

1
300000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 82440 0 0 0 0 0 134622 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17966 0 235645 0 0 0 0 0 0 0 177806 0 0 0 0 262182 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 291460 0 0 0 0 0 0 0 0 0 0 0 ...

output:

912150881

result:

ok 1 number(s): "912150881"

Test #50:

score: 0
Accepted
time: 13ms
memory: 9452kb

input:

1
300000
0 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 0 0 175298 1 0 157906 0 0 1 1 125562 0 0 1 1 0 80478 0 0 1 1 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 152239 1 0 0 0 0 1 0 0 1 229417 1 2565 0 0 0 0 0 1 0 0 0 0 0 0 1 1 1 1 0 60340 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 197241 ...

output:

201697048

result:

ok 1 number(s): "201697048"

Test #51:

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

input:

1
300000
68586 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 199577 0 1 1 1 1 1 1 0 0 1 0 1 1 0 0 0 0 0 0 1 0 0 140057 0 0 0 0 1 0 0 1 235616 1 0 0 0 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 91078 162228 1 0 1 0 0 0 0 0 0 0 1 116650 1 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 1 ...

output:

661151254

result:

ok 1 number(s): "661151254"

Test #52:

score: 0
Accepted
time: 13ms
memory: 9504kb

input:

1
300000
0 0 0 167444 0 0 0 0 0 1 1 0 151186 0 0 1 0 0 1 0 0 61681 0 0 1 0 1 1 0 0 209202 0 0 0 1 0 192083 0 1 257793 1 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 137352 0 0 0 163198 1 0 1 0 0 135262 1 0 0 0 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1...

output:

656884426

result:

ok 1 number(s): "656884426"

Test #53:

score: 0
Accepted
time: 13ms
memory: 9512kb

input:

1
300000
0 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 1 number(s): "1"

Test #54:

score: 0
Accepted
time: 13ms
memory: 9516kb

input:

1
300000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

263476060

result:

ok 1 number(s): "263476060"

Test #55:

score: 0
Accepted
time: 20ms
memory: 9452kb

input:

1
300000
186029 125188 114451 279821 104696 180632 144391 49477 287310 53908 233511 39038 189922 112880 57029 288942 27554 87843 754 102480 176633 115979 221935 249833 88239 61960 252180 20698 156722 124956 82377 138883 226149 150653 163783 170817 133422 220088 223713 195966 286031 256789 53427 1089...

output:

1

result:

ok 1 number(s): "1"

Test #56:

score: 0
Accepted
time: 10ms
memory: 9536kb

input:

1
300000
2 5 1 2 0 1 1 5 0 1 3 1 5 2 1 4 4 0 0 3 1 2 5 0 2 4 5 3 1 3 3 3 1 1 5 3 0 2 3 4 1 5 4 0 1 4 4 4 5 4 3 1 2 3 5 0 5 1 3 5 3 4 3 4 2 0 4 5 4 5 3 5 3 2 2 3 0 1 0 2 2 3 2 4 2 4 3 2 5 1 3 5 5 5 2 2 2 1 2 0 5 2 2 4 0 1 4 5 3 5 2 4 2 4 0 1 0 4 4 2 2 2 4 5 0 4 1 4 0 3 5 5 2 1 3 4 1 5 0 1 1 1 2 4 0 0...

output:

359207513

result:

ok 1 number(s): "359207513"