QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#638772#4929. Longest Unfriendly SubsequenceMaMengQi100 ✓83ms26784kbC++171.3kb2024-10-13 16:53:182024-10-13 16:53:18

詳細信息

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 54ms
memory: 25688kb

input:

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

output:

1

result:

ok single line: '1'

Test #2:

score: 3
Accepted
time: 55ms
memory: 24944kb

input:

1
200000
1521 1638 11981 18811 20091 22081 30494 31501 42139 42282 48197 55520 57632 69584 81745 85026 90303 91482 92176 98507 108061 108743 111257 121226 127217 127449 137116 163474 169192 175764 181243 185402 191244 198775 202845 212156 217723 220058 223478 224205 227614 228398 230425 232567 24480...

output:

198858

result:

ok single line: '198858'

Test #3:

score: 3
Accepted
time: 53ms
memory: 25672kb

input:

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

output:

3

result:

ok single line: '3'

Test #4:

score: 3
Accepted
time: 52ms
memory: 24188kb

input:

1
200000
760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 7601...

output:

575

result:

ok single line: '575'

Test #5:

score: 3
Accepted
time: 54ms
memory: 24756kb

input:

1
200000
22617 30507 37038 41687 43064 43064 49267 55626 59203 73739 82817 99920 109370 115622 115622 121135 121135 129717 129717 133074 133133 133133 142580 142580 142580 154213 154816 154816 161169 180270 186425 208068 213631 237721 252184 261468 266076 271129 271129 272992 278768 279170 299395 31...

output:

136202

result:

ok single line: '136202'

Test #6:

score: 3
Accepted
time: 54ms
memory: 15072kb

input:

5
24325
558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 55...

output:

3
143
605
169
1

result:

ok 5 lines

Test #7:

score: 3
Accepted
time: 60ms
memory: 18288kb

input:

5
86417
13696 27186 31482 38856 51078 60129 60129 63547 67673 87520 97892 99326 118061 118645 146408 154082 166604 178823 201607 241484 250276 265112 265112 265112 266533 267321 312070 312070 314782 320641 321224 325817 328085 351487 365110 374487 382485 385081 393245 400245 419177 421858 423028 426...

output:

68280
264
2
26943
5

result:

ok 5 lines

Test #8:

score: 3
Accepted
time: 53ms
memory: 18392kb

input:

5
2977
112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112...

output:

5
2
186
403
3

result:

ok 5 lines

Test #9:

score: 3
Accepted
time: 50ms
memory: 14848kb

input:

20
11481
2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 224...

output:

84
1
6616
5
157
3
4
173
2652
64
73
2669
97
22009
20
36
4231
33
1
8816

result:

ok 20 lines

Test #10:

score: 3
Accepted
time: 58ms
memory: 11872kb

input:

100
1273
276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 2...

output:

4
3
2906
3
2038
1262
2671
102
1
3
771
34
58
30
2
300
21
106
1
1
72
1
22
1123
5
547
5182
2
87
85
4
1370
158
74
2
1098
61
1027
11
82
1
377
2
715
5
52
67
3
472
158
1
58
6836
75
712
2
59
2
4
52
16
5
2
78
273
4281
36
1178
60
16
2
22
421
5
11
11
33
5
74
3
2
3
3
1770
5
2172
5
67
5
4
480
514
5
57
461
39
5
3...

result:

ok 100 lines

Test #11:

score: 3
Accepted
time: 61ms
memory: 11820kb

input:

1000
309
4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 134343195 241438227 241438227 241438227 241438227 241...

output:

19
4
52
20
182
1
4
91
4
84
2
121
18
14
1
22
9
10
2
7
150
9
76
9
5
5
10
17
46
2
25
17
4
40
397
13
157
12
5
5
78
6
99
3
287
20
86
26
16
8
24
329
28
11
4
9
4
4
10
182
35
20
117
41
1
5
54
1
713
111
8
5
4
2
18
3
38
72
8
1
17
3
2
9
14
25
5
3
2
15
140
6
7
173
81
5
30
2
5
2
8
52
3
16
58
2
146
8
31
4
458
2
1...

result:

ok 1000 lines

Test #12:

score: 3
Accepted
time: 59ms
memory: 11816kb

input:

10000
13
116636133 116636133 206284888 206284888 565476781 812400365 812400365 961195858 961195858 961195858 961195858 961195858 961195858
2
8191780 8191780
43
95905577 95905577 95905577 95905577 95905577 95905577 487815159 487815159 602877460 602877460 602877460 602877460 602877460 602877460 602877...

output:

5
1
8
2
3
10
13
1
2
2
4
2
2
1
5
1
21
3
1
11
13
1
9
1
2
1
2
3
1
8
6
3
26
2
2
3
26
1
15
2
8
1
1
11
9
2
6
2
2
2
10
6
3
8
5
3
2
6
6
16
5
5
2
11
6
1
3
1
1
2
32
5
9
1
1
11
8
3
1
1
3
3
1
3
26
1
43
1
10
1
8
2
1
1
3
21
30
5
19
1
5
16
2
18
1
1
1
13
3
3
4
3
23
3
3
2
1
10
1
13
2
1
14
4
1
3
7
1
1
1
1
2
14
3
5
5
...

result:

ok 10000 lines

Test #13:

score: 3
Accepted
time: 68ms
memory: 7676kb

input:

30000
18
77687359 77687359 77687359 77687359 77687359 77687359 77687359 77687359 264737334 264737334 264737334 264737334 423170703 423170703 423170703 423170703 423170703 423170703
3
426699491 894864848 895502688
23
329836738 329836738 329836738 329836738 329836738 329836738 329836738 329836738 3298...

output:

3
3
4
2
1
4
3
1
5
1
2
2
2
5
2
3
2
1
10
1
2
3
1
4
1
2
1
4
5
2
4
3
3
1
1
1
4
5
1
2
1
6
4
1
10
10
24
1
15
1
1
1
2
1
8
7
1
1
2
3
4
4
4
2
4
3
5
3
5
2
5
15
2
1
1
2
1
1
1
3
5
4
11
1
2
2
7
4
2
1
9
1
1
1
3
1
3
2
1
5
1
2
10
3
4
1
5
8
1
3
7
4
1
1
1
1
2
4
5
3
3
1
1
1
2
2
3
3
5
5
2
4
11
2
2
1
1
5
2
1
1
2
5
5
4
4...

result:

ok 30000 lines

Test #14:

score: 3
Accepted
time: 2ms
memory: 10148kb

input:

1
10000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

1

result:

ok single line: '1'

Subtask #2:

score: 6
Accepted

Test #15:

score: 6
Accepted
time: 0ms
memory: 9764kb

input:

3
5
1 2 1 2 1
7
1 2 3 2 1 2 3
8
1 10 10 1 1 100 100 1

output:

2
6
4

result:

ok 3 lines

Test #16:

score: 6
Accepted
time: 80ms
memory: 7664kb

input:

28653
6
372076545 832760265 372076545 644300403 644300403 644300403
8
540046638 375129642 863244619 863244619 375129642 540046638 540046638 540046638
6
142783193 508154499 871683432 71368434 871683432 871683432
8
760894385 984189193 760894385 323542350 984189193 760894385 323542350 323542350
6
84093...

output:

3
4
4
6
4
4
3
4
5
4
5
4
2
4
5
5
4
3
5
5
4
4
4
5
6
4
2
3
4
3
2
3
4
3
8
4
5
5
4
6
4
5
5
5
4
6
6
4
3
3
7
5
3
7
3
4
6
6
5
4
3
3
6
3
6
4
3
4
4
7
3
4
5
4
5
1
3
6
4
4
4
4
2
3
4
2
5
3
4
2
2
3
4
3
6
3
5
3
4
5
3
3
4
4
5
3
5
4
4
6
5
6
6
4
5
4
5
5
3
4
3
4
4
2
4
4
6
5
4
3
3
2
3
5
4
5
3
3
4
7
4
5
5
2
5
2
4
4
5
4
...

result:

ok 28653 lines

Test #17:

score: 6
Accepted
time: 67ms
memory: 11896kb

input:

27269
6
959945170 761436985 26703386 942397980 959945170 26703386
8
547832867 143323747 65089190 143323747 768500236 65089190 143323747 768500236
5
858824238 403652496 456662012 403652496 361827479
7
434065011 434065011 434065011 217272832 959441476 434065011 441896572
7
436828348 383866500 43682834...

output:

6
7
4
5
3
4
6
4
4
4
6
6
4
5
4
5
5
5
4
4
2
5
5
4
5
3
5
4
7
2
4
7
7
6
3
6
4
6
6
4
5
5
5
4
2
3
6
4
4
5
4
5
5
2
4
5
4
5
5
4
5
7
5
3
4
4
6
4
6
3
4
6
3
5
5
5
5
3
6
6
4
2
5
5
7
5
4
6
4
5
3
3
3
4
5
3
5
4
4
4
4
4
5
5
3
5
5
8
5
4
4
3
3
4
6
3
7
6
2
8
5
4
5
5
3
4
4
6
3
5
5
3
6
6
5
5
5
6
7
5
6
4
4
5
5
3
2
6
6
4
...

result:

ok 27269 lines

Test #18:

score: 6
Accepted
time: 47ms
memory: 9804kb

input:

24412
6
37652408 37652408 731951637 684367047 944732733 37652408
6
699823488 800701256 800701256 168169055 800701256 699823488
7
198445595 198445595 25271422 198445595 61301798 198445595 432743062
6
942430095 168670839 942430095 570524923 942430095 570524923
6
500326576 65482727 500326576 809311072 ...

output:

5
4
5
4
4
5
5
5
4
4
6
3
4
5
6
3
5
5
6
5
5
4
6
6
7
5
6
6
5
4
7
4
5
2
5
4
4
6
5
6
6
4
6
5
4
6
6
4
5
7
5
6
5
4
4
5
6
5
4
3
5
5
4
3
5
5
5
6
2
3
5
4
3
5
5
6
3
4
6
5
5
6
5
6
5
4
3
7
6
5
4
3
5
3
6
5
6
4
5
5
7
5
5
4
5
4
7
6
6
4
4
3
4
4
4
4
5
5
4
5
5
2
5
5
5
4
4
6
6
3
6
4
4
6
6
6
5
3
4
4
4
5
4
5
3
4
4
4
7
6
...

result:

ok 24412 lines

Subtask #3:

score: 8
Accepted

Test #19:

score: 8
Accepted
time: 1ms
memory: 11876kb

input:

1
500
537076440 691668159 871942500 537076440 537076440 691668159 871942500 871942500 537076440 691668159 871942500 537076440 691668159 871942500 537076440 691668159 871942500 537076440 691668159 871942500 537076440 691668159 871942500 871942500 537076440 691668159 871942500 537076440 537076440 6916...

output:

361

result:

ok single line: '361'

Test #20:

score: 8
Accepted
time: 1ms
memory: 11748kb

input:

1
500
584142119 101442702 335815880 584142119 101442702 335815880 584142119 101442702 335815880 584142119 101442702 335815880 584142119 101442702 101442702 335815880 335815880 584142119 584142119 101442702 101442702 335815880 584142119 101442702 335815880 584142119 101442702 335815880 584142119 1014...

output:

394

result:

ok single line: '394'

Test #21:

score: 8
Accepted
time: 1ms
memory: 11812kb

input:

1
500
296341737 806184542 989331127 989331127 296341737 806184542 455929030 296341737 806184542 806184542 806184542 989331127 296341737 806184542 989331127 296341737 806184542 989331127 296341737 806184542 989331127 296341737 806184542 806184542 989331127 296341737 296341737 296341737 806184542 9893...

output:

339

result:

ok single line: '339'

Test #22:

score: 8
Accepted
time: 1ms
memory: 7808kb

input:

1
500
361183277 863317163 788070566 361183277 361183277 863317163 788070566 361183277 632739493 788070566 788070566 361183277 863317163 788070566 361183277 863317163 788070566 361183277 863317163 788070566 361183277 863317163 788070566 361183277 863317163 788070566 361183277 863317163 788070566 3611...

output:

353

result:

ok single line: '353'

Test #23:

score: 8
Accepted
time: 1ms
memory: 11888kb

input:

1
500
360892412 146618517 575516781 360892412 146618517 575516781 360892412 146618517 575516781 360892412 146618517 575516781 360892412 146618517 575516781 360892412 146618517 575516781 360892412 146618517 575516781 360892412 146618517 575516781 360892412 146618517 575516781 360892412 146618517 5755...

output:

423

result:

ok single line: '423'

Test #24:

score: 8
Accepted
time: 1ms
memory: 7740kb

input:

3
68
975239020 470667175 323925950 975239020 470667175 323925950 975239020 470667175 323925950 975239020 470667175 323925950 975239020 470667175 323925950 975239020 470667175 323925950 323925950 323925950 975239020 470667175 323925950 975239020 470667175 323925950 323925950 975239020 470667175 32392...

output:

48
386
3

result:

ok 3 lines

Test #25:

score: 8
Accepted
time: 1ms
memory: 7680kb

input:

3
118
150373656 793064947 635264518 635264518 709296672 793064947 635264518 709296672 709296672 709296672 793064947 635264518 709296672 793064947 635264518 709296672 793064947 793064947 635264518 709296672 793064947 793064947 635264518 709296672 793064947 635264518 709296672 793064947 635264518 7092...

output:

97
230
33

result:

ok 3 lines

Test #26:

score: 8
Accepted
time: 1ms
memory: 7736kb

input:

3
113
89789132 548906728 545868627 545868627 89789132 548906728 545868627 89789132 548906728 545868627 89789132 548906728 545868627 89789132 548906728 545868627 89789132 548906728 545868627 89789132 548906728 545868627 89789132 548906728 545868627 89789132 548906728 545868627 89789132 548906728 5458...

output:

101
127
137

result:

ok 3 lines

Test #27:

score: 8
Accepted
time: 1ms
memory: 9808kb

input:

3
108
794907019 802850140 730657927 730657927 794907019 794907019 802850140 730657927 794907019 802850140 730657927 794907019 794907019 802850140 802850140 730657927 794907019 802850140 730657927 730657927 794907019 802850140 802850140 802850140 802850140 730657927 794907019 802850140 730657927 7306...

output:

78
71
236

result:

ok 3 lines

Test #28:

score: 8
Accepted
time: 1ms
memory: 11904kb

input:

3
55
382906854 86510837 1801762 382906854 86510837 1801762 382906854 382906854 578362690 1801762 382906854 86510837 1801762 382906854 86510837 1801762 1801762 382906854 86510837 1801762 382906854 86510837 1801762 382906854 86510837 1801762 382906854 86510837 382906854 1801762 86510837 382906854 1801...

output:

43
81
289

result:

ok 3 lines

Test #29:

score: 8
Accepted
time: 1ms
memory: 9768kb

input:

20
38
68789463 462582466 279061055 68789463 536943437 279061055 68789463 536943437 279061055 68789463 536943437 279061055 68789463 536943437 279061055 68789463 536943437 279061055 68789463 536943437 279061055 68789463 536943437 279061055 68789463 536943437 279061055 536943437 68789463 279061055 5369...

output:

32
18
20
76
24
7
5
9
5
42
34
25
14
4
10
29
8
16
31
9

result:

ok 20 lines

Test #30:

score: 8
Accepted
time: 1ms
memory: 7660kb

input:

100
8
594931073 674884200 594931073 960542002 674884200 594931073 404937349 674884200
3
28762160 795234252 28762160
6
693736695 693736695 515596726 693736695 568079150 515596726
2
508417829 600345257
4
637967683 731409954 197653780 548314174
9
493559887 493559887 995798571 234632692 493559887 995798...

output:

7
2
4
2
4
7
3
3
3
1
8
1
5
3
1
1
2
5
3
10
3
1
3
6
4
5
5
1
6
2
2
6
9
9
2
7
3
5
8
1
7
11
3
4
3
12
1
1
5
2
4
8
1
1
9
4
1
4
3
14
3
2
1
2
2
3
2
5
4
6
2
9
3
2
5
1
2
9
1
10
3
19
7
2
2
5
1
15
1
1
6
11
1
1
2
1
2
5
8
4

result:

ok 100 lines

Test #31:

score: 8
Accepted
time: 1ms
memory: 7620kb

input:

1
500
3 2 2 3 1 1 1 2 3 2 2 1 3 1 3 3 1 1 3 1 1 2 3 1 1 1 2 2 1 2 1 3 3 2 3 3 2 2 1 2 3 1 2 2 3 3 1 3 3 3 3 3 2 1 2 3 1 3 1 2 1 3 3 1 1 1 1 3 3 1 1 3 3 1 1 1 3 3 2 3 1 1 1 1 1 1 2 1 1 3 1 3 2 1 3 3 1 3 1 1 1 2 3 3 2 1 3 3 3 2 1 3 3 3 1 3 3 1 3 2 2 2 1 1 1 1 3 3 1 2 1 2 2 2 3 3 1 1 1 3 2 3 1 3 3 2 1 ...

output:

162

result:

ok single line: '162'

Test #32:

score: 8
Accepted
time: 1ms
memory: 9796kb

input:

1
500
1 1 1 2 2 1 2 3 2 1 1 3 1 1 1 3 2 3 2 2 1 2 2 3 3 1 3 3 3 2 3 2 2 3 2 3 1 3 1 1 3 2 1 3 3 1 3 2 3 1 3 1 3 2 2 1 1 3 1 2 1 1 1 3 1 2 2 2 2 3 2 3 3 2 1 1 3 2 3 3 3 2 2 2 2 1 1 3 1 1 3 1 3 1 2 1 2 3 2 2 3 1 3 1 1 1 3 3 1 3 3 2 2 1 3 3 1 1 3 1 2 3 3 2 1 2 1 3 1 1 1 2 1 3 1 1 2 1 2 3 3 2 1 3 2 3 2 ...

output:

170

result:

ok single line: '170'

Test #33:

score: 8
Accepted
time: 1ms
memory: 11816kb

input:

1
500
1 3 1 3 1 1 3 1 2 2 1 1 1 1 1 3 3 2 2 3 2 2 1 2 3 1 2 1 3 1 1 1 1 1 3 3 1 3 3 1 1 3 3 3 1 3 1 3 1 2 1 1 2 2 2 1 3 3 2 2 3 3 1 2 3 1 2 3 1 1 1 2 2 1 1 1 2 3 1 3 2 1 1 1 3 3 1 1 1 1 3 2 2 3 3 1 2 2 2 1 3 3 3 1 2 2 1 3 3 2 2 2 1 3 1 2 3 1 2 1 3 3 2 2 2 3 2 1 1 2 1 1 1 1 3 1 3 1 2 1 2 2 2 3 2 1 3 ...

output:

171

result:

ok single line: '171'

Test #34:

score: 8
Accepted
time: 1ms
memory: 7796kb

input:

3
226
2 2 2 3 3 3 3 1 2 1 2 1 3 3 3 2 2 2 1 3 3 3 2 3 3 3 2 2 2 3 3 2 1 2 3 1 3 2 2 3 3 1 2 2 3 1 2 3 1 3 2 1 3 1 2 3 3 3 3 1 3 2 1 3 3 1 1 2 1 3 1 3 1 3 2 2 2 2 1 2 2 2 2 1 2 1 1 3 1 2 2 2 1 2 3 3 1 1 3 3 1 1 2 1 3 3 3 2 3 3 1 3 2 1 2 1 2 3 1 3 3 2 2 2 3 3 3 2 2 3 2 2 1 1 2 2 3 2 2 2 2 3 2 1 2 2 3 ...

output:

81
106
57

result:

ok 3 lines

Test #35:

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

input:

20
23
3 2 3 2 2 1 3 3 1 2 3 1 2 2 2 1 2 1 3 1 1 2 1
19
2 2 3 3 1 2 2 2 3 1 2 3 3 3 1 1 1 2 1
12
2 3 3 2 3 1 3 1 3 2 2 1
39
1 2 1 1 2 2 2 1 2 2 2 1 1 1 3 2 3 1 1 2 1 3 2 2 3 2 2 2 3 1 2 1 3 1 2 1 1 2 1
21
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
24
1 2 3 1 1 1 2 3 1 2 3 2 1 3 3 2 1 3 2 1 3 2 1 3
15
...

output:

10
10
6
11
1
17
6
35
4
2
5
4
3
19
79
22
2
2
5
22

result:

ok 20 lines

Test #36:

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

input:

100
2
1 2
2
1 3
4
2 3 1 2
3
1 1 2
1
3
3
1 2 2
1
3
6
1 2 1 1 3 2
2
3 3
3
3 3 1
5
3 1 3 3 1
1
1
4
3 1 3 3
15
2 3 2 3 2 3 1 3 1 2 2 1 1 1 2
2
3 2
4
2 3 3 3
6
2 2 2 2 1 3
15
1 3 2 1 3 3 1 1 3 3 3 1 2 1 2
4
1 2 3 3
3
2 1 1
9
3 3 3 1 1 2 3 2 1
4
1 1 1 3
11
2 2 3 1 3 2 2 2 2 2 2
5
1 2 1 3 2
4
3 1 3 3
9
3 2...

output:

2
2
4
2
1
2
1
4
1
2
2
1
2
6
2
2
3
7
3
2
5
2
4
4
2
5
4
2
6
5
2
5
2
2
5
5
3
7
6
2
3
2
2
2
1
2
5
2
3
5
2
3
5
7
4
2
2
1
1
15
3
2
3
1
3
1
5
3
2
4
1
2
6
2
5
1
2
4
1
1
1
2
7
2
3
6
1
3
2
4
5
1
2
3
5
1
3
4
2
3

result:

ok 100 lines

Test #37:

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

input:

1
500
455886399 626955833 421163133 892575355 805049331 975659748 741071093 875911704 113500223 113500223 661192282 597935861 597935861 262970158 495955172 153851712 234849549 887929988 887929988 887929988 887929988 542128740 727090845 727090845 685055701 224058754 37318791 519705695 83375459 722649...

output:

469

result:

ok single line: '469'

Test #38:

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

input:

1
500
29435243 925769090 446792611 21667712 789719595 410464435 789287785 96845859 690771702 190228530 64528308 200770249 815748901 521046227 312297467 316401902 401409002 745745759 124319941 371122503 512242376 34813204 305249842 744963641 43370519 348889633 348889633 47719027 937000032 168595842 1...

output:

477

result:

ok single line: '477'

Test #39:

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

input:

1
500
602984088 664773836 177454793 1016966 334198372 285460610 132471773 172555823 678108588 569521673 975831156 698378851 695351143 743016550 389745384 304682329 700880753 700880753 914143778 268616886 223218955 837422858 549920713 672348418 767277498 618713431 61983854 68335376 960714345 60895712...

output:

477

result:

ok single line: '477'

Test #40:

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

input:

1
500
271946887 695308006 271946887 271946887 294535481 695308006 294535481 271946887 271946887 294535481 271946887 695308006 294535481 294535481 271946887 294535481 271946887 695308006 271946887 695308006 294535481 695308006 294535481 271946887 294535481 695308006 294535481 695308006 271946887 6953...

output:

241

result:

ok single line: '241'

Test #41:

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

input:

1
500
720937483 17827429 720937483 971419328 720937483 17827429 971419328 720937483 17827429 720937483 971419328 17827429 720937483 971419328 17827429 971419328 17827429 971419328 720937483 971419328 17827429 720937483 17827429 720937483 971419328 720937483 971419328 720937483 17827429 971419328 178...

output:

232

result:

ok single line: '232'

Test #42:

score: 8
Accepted
time: 1ms
memory: 7804kb

input:

1
500
45706846 591376273 45706846 591376273 45706846 591376273 186758449 45706846 591376273 45706846 591376273 186758449 591376273 186758449 591376273 45706846 186758449 591376273 45706846 186758449 591376273 591376273 186758449 591376273 45706846 591376273 186758449 591376273 186758449 45706846 591...

output:

253

result:

ok single line: '253'

Test #43:

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

input:

1
500
282927666 282927666 484147677 484147677 282927666 484147677 282927666 484147677 282927666 484147677 484147677 282927666 484147677 282927666 484147677 282927666 484147677 282927666 484147677 282927666 484147677 282927666 484147677 484147677 282927666 282927666 484147677 282927666 484147677 2829...

output:

49

result:

ok single line: '49'

Test #44:

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

input:

1
500
151443807 223152423 151443807 223152423 151443807 223152423 151443807 223152423 223152423 151443807 223152423 151443807 223152423 151443807 223152423 151443807 223152423 151443807 223152423 151443807 223152423 151443807 223152423 151443807 223152423 151443807 223152423 151443807 223152423 1514...

output:

14

result:

ok single line: '14'

Test #45:

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

input:

1
500
579768459 816932976 579768459 816932976 579768459 816932976 579768459 579768459 816932976 579768459 327660977 579768459 327660977 327660977 579768459 327660977 579768459 327660977 579768459 327660977 579768459 327660977 579768459 327660977 579768459 327660977 579768459 327660977 327660977 5797...

output:

28

result:

ok single line: '28'

Test #46:

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

input:

1
500
414505640 887314173 414505640 205268028 414505640 887314173 414505640 827649339 887314173 827649339 348309219 827649339 887314173 827649339 348309219 827649339 887314173 827649339 348309219 827649339 887314173 827649339 144164301 887314173 144164301 155363834 144164301 887314173 144164301 7702...

output:

346

result:

ok single line: '346'

Test #47:

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

input:

1
500
671728328 441054685 671728328 645366031 671728328 441054685 671728328 803083316 441054685 803083316 490509277 803083316 441054685 803083316 252342793 441054685 252342793 304397499 252342793 441054685 252342793 211149108 441054685 211149108 83472025 211149108 441054685 211149108 969490582 44105...

output:

331

result:

ok single line: '331'

Test #48:

score: 8
Accepted
time: 1ms
memory: 9780kb

input:

1
500
10771846 877966861 10771846 737001418 10771846 877966861 10771846 737001418 10771846 877966861 10771846 737001418 10771846 877966861 10771846 737001418 10771846 877966861 10771846 737001418 10771846 877966861 10771846 737001418 10771846 877966861 10771846 762757376 877966861 762757376 38921535...

output:

359

result:

ok single line: '359'

Test #49:

score: 8
Accepted
time: 1ms
memory: 9724kb

input:

1
500
259712038 76498306 76498306 259712038 76498306 259712038 76498306 259712038 76498306 259712038 76498306 259712038 76498306 415413414 76498306 415413414 953033042 415413414 953033042 415413414 415413414 953033042 953033042 415413414 953033042 415413414 953033042 415413414 953033042 742889991 74...

output:

61

result:

ok single line: '61'

Test #50:

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

input:

1
500
833260882 375311563 833260882 375311563 833260882 375311563 833260882 375311563 375311563 833260882 833260882 375311563 833260882 375311563 833260882 375311563 833260882 375311563 375311563 833260882 375311563 433607285 375311563 433607285 375311563 433607285 375311563 267102281 375311563 6556...

output:

76

result:

ok single line: '76'

Test #51:

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

input:

1
500
701777023 114316309 701777023 114316309 701777023 114316309 701777023 114316309 701777023 114316309 701777023 701777023 114316309 4578253 114316309 4578253 114316309 114316309 4578253 114316309 4578253 114316309 4578253 114316309 4578253 114316309 4578253 114316309 4578253 114316309 4578253 11...

output:

72

result:

ok single line: '72'

Test #52:

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

input:

1
500
25469206 25469206 212543486 25469206 212543486 25469206 212543486 115107578 212543486 115107578 212543486 115107578 212543486 115107578 115107578 212543486 115107578 212543486 421158058 421158058 212543486 421158058 212543486 421158058 421158058 212543486 421158058 212543486 212543486 42115805...

output:

61

result:

ok single line: '61'

Test #53:

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

input:

1
500
682522770 508839869 682522770 508839869 682522770 508839869 165553515 508839869 165553515 508839869 810406081 508839869 810406081 508839869 165227240 508839869 165227240 508839869 165227240 508839869 165227240 508839869 165227240 508839869 165227240 508839869 165227240 508839869 165227240 5088...

output:

272

result:

ok single line: '272'

Test #54:

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

input:

1
500
409411658 340511656 409411658 340511656 409411658 340511656 409411658 340511656 806492284 885501368 806492284 885501368 806492284 885501368 806492284 885501368 806492284 885501368 806492284 885501368 806492284 885501368 806492284 885501368 806492284 885501368 806492284 885501368 806492284 8855...

output:

124

result:

ok single line: '124'

Test #55:

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

input:

3
94
1 4 3 5 3 4 3 1 7 3 4 1 5 6 4 1 7 6 3 7 5 1 7 6 2 6 5 6 7 5 3 4 7 4 7 4 6 7 2 1 2 2 5 5 1 4 1 6 2 3 1 2 7 4 2 1 2 1 4 7 1 6 2 1 4 3 4 2 3 7 2 7 2 4 1 4 7 1 3 4 6 1 7 1 5 2 5 7 3 7 4 6 2 1
52
1 6 7 7 5 1 7 3 7 3 5 6 7 7 3 6 4 1 6 4 2 2 4 6 5 5 5 6 2 7 5 2 3 1 1 1 3 7 6 4 6 3 2 5 5 7 4 3 7 2 4 2
...

output:

76
37
294

result:

ok 3 lines

Test #56:

score: 8
Accepted
time: 1ms
memory: 11752kb

input:

3
50
1 1 7 5 5 2 7 5 2 7 2 7 5 7 5 3 7 3 3 5 7 5 7 3 7 5 7 3 7 5 7 3 7 3 5 3 5 3 1 1 7 1 1 1 7 3 3 1 7 3
94
7 6 6 7 5 7 6 7 5 5 6 5 7 6 5 6 5 6 5 6 5 6 7 6 7 6 7 6 7 5 7 6 7 5 7 6 7 5 7 5 7 5 6 7 6 5 7 6 5 7 6 6 5 6 5 5 6 7 5 7 6 7 5 6 7 5 6 5 6 7 5 6 5 6 6 5 7 5 6 7 5 7 7 5 7 5 5 7 6 7 6 7 7 6
356
...

output:

28
44
179

result:

ok 3 lines

Test #57:

score: 8
Accepted
time: 1ms
memory: 11748kb

input:

3
139
6 5 6 5 6 5 6 5 5 6 5 6 5 6 5 6 5 6 5 6 6 5 6 5 6 5 6 5 6 5 6 7 6 5 7 5 7 5 7 5 7 5 7 7 5 7 5 7 5 7 5 7 5 7 5 7 7 5 7 7 5 7 5 7 5 7 5 5 7 5 5 5 7 5 7 5 7 5 7 7 5 7 7 5 7 5 7 5 7 5 7 5 5 7 5 7 5 7 5 7 5 7 5 7 5 7 5 7 5 7 5 5 7 5 7 5 7 7 5 7 5 7 5 7 5 7 5 7 5 7 5 5 7 5 7 5 7 5 7
313
1 5 1 5 1 5 ...

output:

6
8
7

result:

ok 3 lines

Test #58:

score: 8
Accepted
time: 1ms
memory: 11816kb

input:

3
190
3 5 3 1 3 5 3 1 3 5 3 1 3 5 3 1 3 5 3 1 3 5 3 1 3 5 3 2 5 2 7 2 5 2 7 2 5 2 7 2 5 2 7 2 5 2 3 5 3 1 3 5 3 1 3 5 3 1 3 5 3 1 3 5 3 1 3 5 3 1 3 5 3 1 3 5 3 2 5 2 7 2 5 2 7 2 5 2 7 2 5 2 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 6 4 5 4 ...

output:

139
118
101

result:

ok 3 lines

Test #59:

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

input:

3
130
3 2 3 2 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 2 5 2 5 2 5 1 5 1 5 1 5 1 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 6 2 6 2 6 2 6 2 6 2 6 2 2 1 2 1 2 1 2 1 4 1 4 1 4 1 4 1 4 6 4 6 4 6 4 6 5 6 5 6 5 6 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5
74
4 6 6 6 4 6 4 6 4 6 6 4 6 4 4 6...

output:

20
9
51

result:

ok 3 lines

Test #60:

score: 8
Accepted
time: 1ms
memory: 7808kb

input:

3
107
6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 4 7 4 3 4 7 4 1 7 1 5 1 7 1 5 1 7 1 4 7 4 6 4 7 4 7 3 5 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 3 4 4 3 4 3 4 3 4 3 4 5 7 5 7 7 3 7 5 7 5 3 5 7 3 5 7 6 1 1 6 7 1 6 1 7 6 1
73
2 3 2 6 2 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 1 6 7 5 6...

output:

57
17
92

result:

ok 3 lines

Test #61:

score: 8
Accepted
time: 1ms
memory: 7672kb

input:

3
146
905971758 240705216 290005132 536589372 460138502 563090429 725778480 26169743 637578914 392036242 235133216 533603958 883176441 883176441 42792325 656076467 933696550 673478376 835737951 748712810 194445723 891601325 555381933 985608038 597901844 939157103 718305152 566848749 594357652 652864...

output:

140
178
158

result:

ok 3 lines

Test #62:

score: 8
Accepted
time: 1ms
memory: 11812kb

input:

3
49
74830278 539516613 74830278 539516613 784024584 74830278 784024584 74830278 784024584 74830278 784024584 539516613 784024584 539516613 784024584 539516613 74830278 539516613 784024584 74830278 784024584 539516613 784024584 539516613 784024584 539516613 784024584 539516613 74830278 784024584 748...

output:

20
143
98

result:

ok 3 lines

Test #63:

score: 8
Accepted
time: 1ms
memory: 7660kb

input:

3
320
662263417 662263417 759212235 662263417 759212235 759212235 662263417 759212235 662263417 759212235 662263417 759212235 662263417 759212235 662263417 759212235 662263417 759212235 662263417 759212235 662263417 759212235 757302985 757302985 662263417 759212235 757302985 662263417 757302985 7573...

output:

42
9
6

result:

ok 3 lines

Test #64:

score: 8
Accepted
time: 1ms
memory: 9768kb

input:

3
66
635958303 572691027 635958303 753983766 635958303 572691027 635958303 753983766 635958303 572691027 635958303 910469217 572691027 910469217 459355619 910469217 572691027 910469217 965777089 572691027 965777089 888016580 965777089 572691027 965777089 888016580 965777089 572691027 965777089 88801...

output:

47
199
90

result:

ok 3 lines

Test #65:

score: 8
Accepted
time: 1ms
memory: 7824kb

input:

3
365
563779268 572686550 746125689 572686550 746125689 572686550 746125689 572686550 746125689 572686550 746125689 572686550 746125689 746125689 572686550 746125689 572686550 84079729 84079729 572686550 84079729 572686550 84079729 406080738 84079729 406080738 84079729 406080738 84079729 406080738 4...

output:

56
12
9

result:

ok 3 lines

Test #66:

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

input:

3
361
595120737 491102101 595120737 491102101 595120737 832860755 595120737 832860755 595120737 832860755 736132025 832860755 832860755 736132025 832860755 736132025 736132025 832860755 736132025 4935212 96717202 336300849 96717202 336300849 501484470 336300849 501484470 336300849 501484470 78987245...

output:

147
4
66

result:

ok 3 lines

Test #67:

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

input:

10
61
26262500 240243187 237605778 28465702 102474829 431061606 310285858 101698003 596018567 698370876 852860590 318488204 489778201 843922819 706993266 409247144 444122524 785662333 54507781 220155124 463482685 415924514 967953100 443774257 534915647 760684187 312341892 294928021 958814839 4706823...

output:

60
5
7
6
47
5
11
33
131
155

result:

ok 10 lines

Test #68:

score: 8
Accepted
time: 1ms
memory: 9764kb

input:

10
6
700522940 296770226 700522940 700522940 738757773 700522940
13
180402080 105717690 979369373 180402080 979369373 105717690 180402080 979369373 105717690 374355075 656232386 656232386 374355075
67
697908824 792580337 697908824 542154874 792580337 697908824 792580337 697908824 235065059 697908824...

output:

4
9
37
24
10
63
83
19
13
10

result:

ok 10 lines

Test #69:

score: 8
Accepted
time: 1ms
memory: 9856kb

input:

10
56
934591892 58329970 934591892 58329970 934591892 58329970 934591892 58329970 934591892 58329970 934591892 58329970 934591892 58329970 52828378 58329970 934591892 52828378 794728475 934591892 52828378 934591892 794728475 52828378 794728475 934591892 52828378 794728475 934591892 52828378 79472847...

output:

23
2
4
11
5
5
5
13
2
2

result:

ok 10 lines

Test #70:

score: 8
Accepted
time: 1ms
memory: 11820kb

input:

10
36
107463914 913609990 107463914 368438061 107463914 913609990 107463914 368438061 107463914 913609990 107463914 511278029 414697574 511278029 575972110 511278029 414697574 511278029 33707345 414697574 33707345 889876537 33707345 414697574 33707345 889876537 33707345 414697574 33707345 285018984 ...

output:

26
50
85
43
15
3
48
4
35
45

result:

ok 10 lines

Test #71:

score: 8
Accepted
time: 1ms
memory: 11804kb

input:

10
18
283112771 436225265 283112771 436225265 283112771 436225265 283112771 436225265 283112771 436225265 283112771 436225265 283112771 436225265 283112771 591466704 283112771 591466704
1
861163789
28
349333071 926730064 349333071 926730064 86207441 926730064 86207441 926730064 86207441 926730064 86...

output:

4
1
7
2
16
2
2
24
2
20

result:

ok 10 lines

Test #72:

score: 8
Accepted
time: 1ms
memory: 9772kb

input:

10
40
583660420 128778708 583660420 418338271 797588694 418338271 418338271 36416458 797588694 418338271 36416458 418338271 609195672 547273127 88921181 915282122 252885739 915282122 915282122 252885739 915282122 252885739 915282122 845921357 315576577 845921357 74770157 79216870 866919853 129145613...

output:

25
30
46
15
3
12
39
11
14
17

result:

ok 10 lines

Test #73:

score: 8
Accepted
time: 1ms
memory: 11808kb

input:

100
1
13230502
6
613065989 209589809 209589809 27485586 951264264 410243397
11
712826200 128754523 499514641 619949545 304091114 595574683 898865435 521720060 115391977 409473053 10001963
11
843849239 576984692 99319972 428828222 290932762 98181009 890551489 185106247 116388923 376464259 964668849
1...

output:

1
5
11
11
10
7
2
3
8
1
1
5
2
2
1
1
5
3
6
2
6
2
4
4
5
9
7
3
1
13
5
6
4
2
1
1
2
3
1
3
1
3
2
3
8
10
3
2
4
4
4
2
2
7
2
1
8
3
2
1
6
11
3
2
6
3
2
5
2
8
1
2
5
20
10
5
5
1
8
13
7
1
10
4
9
2
5
13
7
16
6
3
8
2
4
1
6
2
1
5

result:

ok 100 lines

Test #74:

score: 8
Accepted
time: 1ms
memory: 11824kb

input:

100
2
800872870 982239765
24
59122782 536038598 59122782 59122782 268124857 247528547 59122782 247528547 268124857 59122782 268124857 268124857 210119477 247528547 268124857 247528547 268124857 268124857 268124857 210119477 247528547 210119477 247528547 268124857
3
924271158 328390958 670114185
4
69...

output:

2
13
3
3
6
5
4
1
2
2
2
4
1
2
2
6
3
1
2
1
3
4
1
2
4
2
2
2
2
2
1
7
2
2
1
3
8
4
5
5
4
8
10
17
3
4
4
2
4
4
3
3
3
2
1
1
1
6
4
1
1
6
6
5
9
8
2
1
2
3
2
2
2
2
2
2
6
3
6
2
4
2
2
1
5
1
6
2
2
1
1
4
2
4
2
2
3
2
3
5

result:

ok 100 lines

Test #75:

score: 8
Accepted
time: 1ms
memory: 7732kb

input:

100
4
783340795 310809792 783340795 310809792
5
119722408 47065596 119722408 47065596 119722408
3
880830920 535205516 880830920
1
248474769
14
653960744 455546860 653960744 455546860 653960744 455546860 653960744 653960744 455546860 653960744 455546860 653960744 653960744 455546860
2
103385893 71602...

output:

2
2
2
1
2
2
2
2
2
2
2
2
4
1
2
2
2
4
2
2
2
1
1
2
1
2
2
2
2
2
2
2
2
2
2
1
1
2
2
2
2
4
2
1
2
2
2
5
2
2
5
2
2
2
2
2
2
2
2
1
2
2
2
1
2
2
1
2
2
2
2
1
2
3
2
2
1
5
2
2
2
2
2
1
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2

result:

ok 100 lines

Test #76:

score: 8
Accepted
time: 1ms
memory: 9856kb

input:

100
8
653040023 272349230 566423990 821901787 977088214 977088214 585105781 182463393
2
138672826 237919522
2
478558926 312699166
6
472471053 194597476 739853989 739853989 466984027 544388286
4
96354375 968990285 741582104 786470599
3
582931827 597819817 951992025
6
300035070 757113713 712710617 601...

output:

7
2
2
5
4
3
5
2
6
2
2
2
4
6
4
2
4
5
2
3
1
7
10
7
3
1
5
4
2
4
6
5
2
1
1
5
3
16
3
3
15
4
3
6
12
1
4
3
6
1
1
1
1
1
3
1
3
7
5
1
14
14
5
14
8
5
11
3
4
12
13
3
1
2
6
1
10
6
6
4
8
8
7
5
5
2
3
2
3
4
1
5
3
1
4
4
4
4
1
3

result:

ok 100 lines

Test #77:

score: 8
Accepted
time: 2ms
memory: 11764kb

input:

100
1
653986630
7
78293455 81369374 78293455 140941205 78293455 78293455 140941205
1
353165852
8
217304646 79414 217304646 79414 217304646 79414 217304646 312122830
3
230131296 814455042 230131296
3
278976992 410137720 278976992
9
456114454 655155254 456114454 655155254 220030737 655155254 220030737...

output:

1
4
1
3
2
2
4
2
2
2
1
3
3
2
2
2
3
3
1
2
3
1
2
2
1
2
2
1
2
2
2
2
2
2
1
4
2
2
2
2
2
2
2
2
4
1
2
1
3
2
2
2
2
2
2
2
2
2
5
2
11
2
1
2
2
4
2
2
2
2
1
2
2
2
2
2
2
3
2
2
2
2
2
4
2
2
2
2
1
2
2
8
3
2
1
2
1
2
2
6

result:

ok 100 lines

Test #78:

score: 8
Accepted
time: 1ms
memory: 7740kb

input:

100
5
887163735 579534916 530441529 430846330 923345818
1
810929256
6
890875426 890875426 657094919 890875426 657094919 890875426
6
546280728 232809358 687997147 232809358 687997147 232809358
8
763532350 892527595 787186795 539587226 963903850 175053045 692102911 159230362
3
116924919 841116202 7753...

output:

5
1
2
3
8
3
3
6
2
5
5
1
3
1
1
1
7
1
3
2
1
5
5
2
6
2
2
2
9
1
15
2
1
2
8
1
1
1
4
1
7
8
5
2
3
3
6
1
3
5
3
5
2
8
4
7
11
13
4
2
5
6
6
3
3
1
3
4
12
5
2
1
3
1
2
2
3
1
5
5
2
6
11
4
9
2
5
5
2
3
5
2
2
2
11
2
10
6
1
5

result:

ok 100 lines

Subtask #4:

score: 10
Accepted

Test #79:

score: 10
Accepted
time: 22ms
memory: 25684kb

input:

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

output:

66691

result:

ok single line: '66691'

Test #80:

score: 10
Accepted
time: 24ms
memory: 26684kb

input:

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

output:

66403

result:

ok single line: '66403'

Test #81:

score: 10
Accepted
time: 28ms
memory: 25684kb

input:

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

output:

113082

result:

ok single line: '113082'

Test #82:

score: 10
Accepted
time: 23ms
memory: 26684kb

input:

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

output:

98984

result:

ok single line: '98984'

Test #83:

score: 10
Accepted
time: 26ms
memory: 24000kb

input:

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

output:

66809

result:

ok single line: '66809'

Test #84:

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

input:

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

output:

66929

result:

ok single line: '66929'

Test #85:

score: 10
Accepted
time: 19ms
memory: 25676kb

input:

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

output:

165153

result:

ok single line: '165153'

Test #86:

score: 10
Accepted
time: 22ms
memory: 24120kb

input:

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

output:

161302

result:

ok single line: '161302'

Test #87:

score: 10
Accepted
time: 23ms
memory: 19652kb

input:

3
14732
1 3 2 1 3 3 1 1 3 2 1 2 1 1 1 3 1 3 1 1 3 2 1 1 3 2 3 3 2 1 3 3 3 3 1 1 1 2 3 2 1 3 3 3 1 2 1 1 3 1 1 2 2 1 3 3 3 2 3 2 1 2 2 3 1 3 3 2 2 3 1 2 1 1 3 2 2 2 1 2 3 3 1 3 3 2 1 1 1 1 2 1 3 1 2 3 3 2 2 1 3 3 3 2 2 2 1 1 1 1 1 2 1 2 1 3 2 2 1 3 2 3 2 3 3 1 3 1 1 2 1 1 2 1 1 3 2 1 2 3 2 1 3 1 3 3 ...

output:

4957
130118
23430

result:

ok 3 lines

Test #88:

score: 10
Accepted
time: 24ms
memory: 18760kb

input:

3
46973
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 ...

output:

35431
19615
37542

result:

ok 3 lines

Test #89:

score: 10
Accepted
time: 28ms
memory: 17416kb

input:

3
19336
2 3 1 2 2 3 1 1 2 3 3 1 2 2 2 3 3 3 1 2 3 1 2 2 3 3 3 1 1 1 1 1 2 2 3 3 3 3 1 1 1 2 2 2 2 3 1 1 1 1 2 2 2 3 3 3 3 1 1 2 2 2 3 1 2 3 1 2 2 3 3 3 1 2 3 1 2 3 1 2 3 3 1 1 2 3 3 1 2 2 2 2 2 2 3 3 1 2 3 1 2 2 3 3 1 1 1 1 2 3 1 1 1 1 1 2 2 2 2 2 2 3 3 3 1 2 3 1 2 3 3 1 2 3 3 3 3 3 3 1 2 2 2 2 2 2 ...

output:

8087
53502
40182

result:

ok 3 lines

Test #90:

score: 10
Accepted
time: 28ms
memory: 18456kb

input:

3
111453
2 3 2 2 3 2 2 2 1 1 1 2 2 2 3 2 2 1 3 1 3 3 1 3 2 2 1 3 1 2 2 2 3 1 3 2 1 2 1 1 3 3 1 1 3 1 1 2 1 2 1 1 1 3 3 3 1 1 1 3 2 2 1 3 2 1 1 3 1 2 3 3 1 2 2 2 1 3 2 2 2 2 2 2 2 3 2 1 3 1 2 1 3 1 1 1 2 3 3 1 3 2 1 3 2 2 2 3 1 3 3 3 2 1 3 2 1 3 2 1 3 3 3 1 1 2 1 2 1 3 2 2 2 3 3 1 2 1 2 2 3 3 2 2 2 2...

output:

37432
9380
2

result:

ok 3 lines

Test #91:

score: 10
Accepted
time: 23ms
memory: 24248kb

input:

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

output:

161232

result:

ok single line: '161232'

Test #92:

score: 10
Accepted
time: 26ms
memory: 24780kb

input:

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

output:

177380

result:

ok single line: '177380'

Test #93:

score: 10
Accepted
time: 23ms
memory: 24900kb

input:

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

output:

152945

result:

ok single line: '152945'

Test #94:

score: 10
Accepted
time: 26ms
memory: 24684kb

input:

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

output:

139711

result:

ok single line: '139711'

Test #95:

score: 10
Accepted
time: 21ms
memory: 25668kb

input:

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

output:

159913

result:

ok single line: '159913'

Test #96:

score: 10
Accepted
time: 25ms
memory: 24016kb

input:

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

output:

164070

result:

ok single line: '164070'

Test #97:

score: 10
Accepted
time: 23ms
memory: 26600kb

input:

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

output:

141972

result:

ok single line: '141972'

Test #98:

score: 10
Accepted
time: 24ms
memory: 26752kb

input:

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

output:

180569

result:

ok single line: '180569'

Test #99:

score: 10
Accepted
time: 26ms
memory: 19296kb

input:

3
67258
1 3 2 1 3 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 1 3 2 2 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 2 1 3 2 1 ...

output:

55713
10294
102575

result:

ok 3 lines

Test #100:

score: 10
Accepted
time: 21ms
memory: 17388kb

input:

3
110746
2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 1 2 3 3 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 1 2 3 3 1 2 3 1 2 3 1 2 3 1 1 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2...

output:

78787
56073
17413

result:

ok 3 lines

Test #101:

score: 10
Accepted
time: 22ms
memory: 16716kb

input:

3
88522
1 2 2 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 3 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 3 1 2 2 3 1 2 3 1 2 3 1 1 2 3 1 2 2 3 1 2 3 3 1 2 3 3 1 2 3 3 1 2 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 1 2 3 3 1 1 1 2 3 1 2 3 1 ...

output:

72954
15040
67627

result:

ok 3 lines

Test #102:

score: 10
Accepted
time: 21ms
memory: 18032kb

input:

3
38399
2 1 1 3 2 1 3 2 1 3 3 3 2 1 3 2 1 3 3 2 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 3 2 1 1 1 3 2 1 3 2 1 3 3 3 2 2 2 1 3 2 1 3 3 2 1 1 1 3 2 1 3 2 1 3 2 2 1 3 2 2 1 3 2 1 3 2 1 3 2 ...

output:

27852
58832
74901

result:

ok 3 lines

Test #103:

score: 10
Accepted
time: 26ms
memory: 14068kb

input:

10
23759
3 2 1 2 1 2 1 2 2 2 2 1 1 1 3 1 3 1 3 3 2 1 1 3 3 2 3 2 2 1 3 2 3 3 2 1 3 1 2 3 3 3 2 1 1 3 3 1 2 3 3 2 3 3 1 2 3 3 2 2 1 2 3 2 3 1 1 3 3 3 2 3 3 3 1 1 3 2 3 2 2 3 2 1 1 1 1 2 1 3 3 1 3 2 3 3 1 3 3 1 1 2 3 1 3 2 3 3 2 2 3 1 3 3 2 3 1 3 2 3 3 3 1 2 3 2 3 1 3 1 3 2 2 3 3 2 1 2 2 2 3 1 2 2 2 2...

output:

8049
15976
3898
1817
4647
15431
43707
2827
2372
17780

result:

ok 10 lines

Test #104:

score: 10
Accepted
time: 27ms
memory: 12768kb

input:

15
3978
2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 3 1 2 2 2 3 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 1 1 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 2 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 1 1 2 3 3 3 1 2 3 1 ...

output:

2648
2
12485
3542
2427
2686
13541
17826
1973
10284
16751
13183
2992
4312
643

result:

ok 15 lines

Test #105:

score: 10
Accepted
time: 19ms
memory: 12124kb

input:

20
2162
3 2 3 1 2 2 3 3 1 1 1 2 2 2 3 3 2 2 1 3 2 1 3 3 3 3 2 1 2 1 1 1 3 1 1 2 2 1 2 3 3 2 3 1 1 1 1 3 3 1 3 3 1 1 2 3 3 1 2 2 3 3 2 3 2 3 3 2 2 2 1 1 3 3 2 2 1 3 3 2 3 3 1 1 3 2 2 2 1 2 3 1 3 3 3 1 2 2 2 1 1 1 2 2 3 1 1 3 3 1 3 2 3 1 1 1 2 1 3 1 3 3 2 1 1 2 1 1 3 1 1 2 2 3 2 2 2 1 3 3 3 3 3 2 1 1 ...

output:

754
605
5276
265
12917
210
69
4263
11833
610
2550
5415
3601
12242
4287
5965
1729
16708
1764
1028

result:

ok 20 lines

Test #106:

score: 10
Accepted
time: 26ms
memory: 10384kb

input:

50
3286
2 3 1 2 2 1 2 1 2 2 1 1 2 3 2 3 3 1 3 1 1 1 1 3 3 1 3 3 3 1 2 2 2 2 1 1 1 2 3 1 2 1 2 1 2 3 1 3 1 1 1 1 2 1 3 1 2 2 1 2 1 2 3 3 1 2 1 2 1 2 1 2 2 2 2 2 1 2 3 1 2 1 1 3 2 3 1 1 3 2 1 2 1 1 1 2 2 3 1 1 3 1 1 2 2 3 1 2 2 3 2 3 3 2 1 2 3 3 2 3 1 3 2 2 2 3 3 3 1 2 3 3 3 3 2 3 2 1 2 1 2 1 3 1 2 3 ...

output:

1094
2039
1266
311
3566
734
3452
921
6366
1785
1886
46
250
1156
2209
480
856
891
1475
1903
98
1610
6239
2069
1169
4200
1325
2769
31
956
206
4259
6816
2833
474
3248
818
2818
1
398
160
54
1866
4308
3127
5468
1697
282
1209
1567

result:

ok 50 lines

Test #107:

score: 10
Accepted
time: 26ms
memory: 10092kb

input:

100
1
2
8738
3 3 3 2 2 3 2 1 1 2 2 2 3 2 2 1 1 3 2 2 3 2 3 1 3 3 1 3 2 2 1 1 3 2 1 1 3 1 1 1 1 2 2 2 2 1 3 3 2 2 1 2 1 2 1 1 2 2 1 1 2 2 1 2 3 1 1 3 2 2 1 1 3 1 2 3 2 1 3 1 1 1 3 2 1 3 3 3 2 3 3 3 1 2 1 3 3 1 2 3 2 1 3 3 3 3 1 1 3 2 1 1 2 2 2 2 2 1 3 1 2 3 3 3 2 1 3 3 1 3 2 3 2 1 2 3 1 1 2 2 3 3 2 2...

output:

1
2913
447
199
486
258
178
1822
6779
5048
3183
250
179
1857
719
194
98
510
6409
137
388
186
2
85
705
90
155
2627
766
203
413
550
1863
1
515
97
475
1
21
1282
1064
2382
471
276
557
137
112
225
185
921
1869
4
1877
84
353
1369
1175
717
2
507
1358
328
762
525
239
223
49
189
621
1229
427
911
830
2306
3726...

result:

ok 100 lines

Test #108:

score: 10
Accepted
time: 23ms
memory: 10008kb

input:

200
799
2 2 1 1 2 3 3 2 2 2 2 2 1 2 3 3 2 3 3 3 1 3 1 1 2 3 1 3 1 1 3 2 1 3 3 1 3 2 1 1 3 3 1 3 2 1 2 3 3 2 3 3 2 1 2 1 2 2 3 2 1 1 2 1 1 1 1 3 1 2 2 1 3 3 3 3 3 3 2 1 1 3 2 1 2 1 3 1 1 2 3 1 1 1 2 1 1 1 1 1 2 2 3 2 1 2 2 2 2 1 1 3 2 3 2 2 2 2 2 3 2 3 2 2 2 3 2 1 3 3 2 2 3 1 2 2 1 1 1 2 3 1 2 1 3 2 ...

output:

272
219
2
866
1052
234
752
479
66
608
263
503
2073
36
231
1498
315
29
116
514
589
168
905
15
985
18
148
657
2668
1219
580
210
1025
6
41
552
565
181
1702
386
371
154
25
268
2
466
75
151
26
1010
92
700
2157
594
2
1081
168
801
197
157
41
211
902
499
1177
465
101
95
142
500
616
200
51
244
172
630
83
918...

result:

ok 200 lines

Test #109:

score: 10
Accepted
time: 26ms
memory: 7756kb

input:

500
34
2 2 2 2 2 3 3 3 1 2 3 3 1 1 1 2 1 1 3 3 3 3 2 1 3 2 2 2 1 1 3 3 2 1
7
2 1 2 1 1 2 2
333
3 2 1 2 1 1 3 1 1 2 1 2 3 3 3 2 2 1 1 1 1 2 1 3 1 3 1 2 2 2 2 1 3 1 3 3 1 2 3 2 3 1 3 3 3 2 3 1 2 2 1 1 2 3 2 2 3 2 1 3 1 2 1 1 3 1 3 1 2 1 2 2 3 1 1 3 2 2 2 3 2 1 3 1 2 1 3 3 1 3 3 2 2 2 3 2 1 1 3 2 2 3 1...

output:

14
2
124
74
641
27
298
259
91
99
36
568
75
34
164
52
380
59
264
168
88
218
31
89
123
277
23
178
52
439
189
2
162
411
68
1733
348
2
52
354
38
265
10
179
2
80
222
46
298
207
69
547
83
77
117
110
19
414
237
97
111
88
89
36
139
214
266
429
37
629
129
169
42
22
4
84
91
32
231
43
141
168
336
49
40
248
6
4...

result:

ok 500 lines

Test #110:

score: 10
Accepted
time: 28ms
memory: 11756kb

input:

1000
294
3 3 1 1 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 1 2 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 3 1 2 3 1 1 2 3 1 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3...

output:

259
87
166
81
32
102
157
101
53
79
126
39
20
50
17
82
23
41
21
70
95
1
14
38
4
116
52
243
21
136
55
1
1
127
12
59
86
52
106
223
12
6
223
23
12
166
50
11
2
152
51
220
13
59
53
10
174
94
14
333
11
70
89
7
111
5
178
31
89
81
44
25
70
449
7
180
45
122
134
113
138
41
2
1
93
59
21
11
113
55
43
100
12
103
...

result:

ok 1000 lines

Test #111:

score: 10
Accepted
time: 20ms
memory: 11820kb

input:

10000
99
2 3 3 1 2 3 3 3 1 2 3 1 2 3 3 3 1 2 2 2 3 1 2 3 1 1 2 3 1 2 2 3 1 2 3 3 1 2 2 2 2 3 1 2 3 3 3 1 2 2 3 1 2 3 3 3 3 1 2 3 1 2 2 2 3 1 1 2 3 1 2 3 3 3 1 2 3 1 2 2 3 3 3 3 1 1 1 1 1 1 2 2 2 3 3 3 1 1 2
9
3 1 2 3 3 1 2 1 3
50
3 3 1 2 3 2 1 3 2 1 3 2 1 3 3 2 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 2 ...

output:

61
7
40
60
3
5
1
1
6
2
6
6
1
16
2
14
1
4
3
1
15
5
14
15
3
26
2
5
12
23
5
3
2
9
4
4
2
40
8
25
8
14
5
11
4
11
8
7
2
12
3
4
10
22
16
4
40
2
8
32
24
8
27
22
37
1
2
3
7
15
2
8
6
12
22
4
9
7
12
8
12
3
25
12
5
6
7
6
17
8
6
8
13
2
22
32
5
16
2
4
5
1
5
2
19
2
6
19
28
3
2
2
10
25
17
10
8
4
2
12
7
15
5
5
32
14...

result:

ok 10000 lines

Test #112:

score: 10
Accepted
time: 28ms
memory: 11748kb

input:

20000
9
3 3 2 3 2 2 3 1 2
9
1 1 1 2 2 3 3 2 3
5
2 3 2 1 1
6
2 2 1 2 3 1
7
2 2 2 2 1 3 3
1
1
8
2 1 3 2 2 1 3 2
14
3 3 1 3 2 3 3 1 3 1 3 3 2 3
5
1 2 1 1 1
5
3 2 1 1 2
9
3 2 1 1 1 2 3 1 3
7
1 1 2 3 1 1 1
1
2
5
3 2 1 1 2
29
3 1 1 2 2 1 1 2 3 3 3 1 1 3 2 1 2 3 3 1 3 3 2 3 1 3 3 1 2
6
3 3 1 2 3 1
12
2 3 1...

output:

4
3
3
4
3
1
7
7
2
3
5
4
1
3
12
5
5
8
17
2
2
27
8
10
51
11
4
14
2
3
7
10
6
2
2
4
4
5
5
18
7
1
6
3
2
2
3
2
7
3
5
4
9
1
3
2
1
25
5
9
2
4
4
5
6
2
3
1
2
2
8
2
4
1
20
5
6
1
2
5
2
7
1
3
2
1
6
9
10
4
2
6
16
2
2
1
1
5
11
4
5
4
1
11
1
6
6
14
2
3
8
2
11
12
4
3
14
25
18
2
2
4
16
6
4
3
9
3
1
3
2
5
9
15
5
18
5
6
...

result:

ok 20000 lines

Test #113:

score: 10
Accepted
time: 40ms
memory: 9788kb

input:

50000
5
3 1 3 2 2
1
1
1
3
6
2 1 1 3 3 2
9
3 3 1 1 2 1 3 2 3
1
2
8
2 2 2 2 3 3 2 1
2
1 2
2
3 2
2
2 1
1
1
2
1 3
3
1 3 2
6
3 1 1 1 1 3
4
2 2 2 3
6
1 1 1 2 1 1
3
3 3 1
15
2 3 1 2 3 1 2 3 1 3 2 1 3 2 2
1
3
4
2 1 3 2
2
1 2
4
1 1 2 1
2
2 1
2
1 3
1
2
5
3 3 2 2 1
5
2 3 3 2 3
3
2 2 1
1
2
6
2 3 3 3 3 2
3
2 1 3...

output:

3
1
1
4
5
1
3
2
2
2
1
2
3
2
2
2
2
11
1
4
2
2
2
2
1
3
2
2
1
2
3
1
2
2
1
3
2
5
3
2
2
3
3
4
3
4
1
6
2
4
2
5
3
3
1
1
2
9
3
1
2
3
2
5
2
2
2
3
8
2
2
9
2
1
1
1
3
3
8
2
2
1
2
9
3
1
2
1
7
2
2
2
2
2
1
7
1
2
2
5
2
6
8
3
4
2
1
4
3
9
1
4
1
4
2
3
4
1
1
5
2
2
2
2
1
5
2
7
3
5
5
1
1
2
1
1
2
1
1
1
5
3
1
3
2
1
4
1
1
4...

result:

ok 50000 lines

Test #114:

score: 10
Accepted
time: 2ms
memory: 7964kb

input:

1
10000
2 3 3 1 2 2 2 3 1 1 2 2 3 3 3 1 2 3 3 1 2 3 3 1 1 2 3 1 1 1 1 2 2 3 3 1 2 2 3 1 1 2 3 1 1 1 1 2 2 2 3 3 3 1 1 2 3 1 2 3 1 1 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 1 1 1 1 1 2 3 1 2 2 2 3 3 1 2 3 3 3 1 1 1 2 3 1 2 3 1 2 2 2 3 1 2 3 1 2 3 1 1 1 2 3 3 1 2 2 2 3 3 1 2 3 3 3 3 3 1 2 2 2 3 1 2 ...

output:

4765

result:

ok single line: '4765'

Test #115:

score: 10
Accepted
time: 2ms
memory: 9924kb

input:

1
10000
1 1 2 2 1 2 1 3 1 3 3 3 3 1 3 1 1 1 1 2 1 3 3 1 2 3 2 3 2 3 1 3 1 3 1 1 1 2 1 1 1 3 3 3 2 1 2 1 3 2 1 3 2 2 1 3 1 2 2 2 2 1 2 2 3 2 2 3 3 2 2 3 2 1 3 3 1 3 3 3 3 1 3 1 1 3 1 3 2 3 3 3 3 3 2 3 3 1 1 3 1 2 2 2 3 1 1 1 2 1 3 2 2 1 1 2 1 3 2 1 2 3 3 2 2 3 3 3 3 1 2 1 3 2 3 2 2 1 1 1 2 2 2 1 1 2 ...

output:

3368

result:

ok single line: '3368'

Test #116:

score: 10
Accepted
time: 2ms
memory: 11840kb

input:

3
2025
1 3 3 1 2 3 1 1 1 2 2 1 2 2 1 2 3 3 2 1 2 3 1 1 2 1 1 1 2 2 2 1 3 1 1 2 3 1 1 3 3 3 2 2 2 2 2 2 1 2 3 1 3 3 2 2 2 3 1 3 3 3 3 3 2 3 1 2 1 3 3 1 3 3 3 1 2 3 2 3 2 2 3 1 1 1 1 3 2 2 3 3 1 1 2 1 3 1 1 3 1 2 2 1 1 2 1 3 2 2 3 1 1 2 1 3 1 2 3 1 3 2 2 3 3 1 3 2 3 2 1 2 2 3 1 3 2 2 1 3 1 1 3 1 2 2 2...

output:

694
953
2972

result:

ok 3 lines

Test #117:

score: 10
Accepted
time: 2ms
memory: 11824kb

input:

20
518
3 3 2 1 1 1 3 1 3 2 1 3 1 2 1 1 3 3 2 3 1 3 1 1 2 1 3 3 2 1 3 2 2 1 3 1 2 3 3 1 2 1 3 1 2 3 3 1 1 2 2 1 3 1 3 2 2 1 2 2 3 1 2 2 2 1 3 3 3 3 1 1 3 3 3 3 1 1 1 2 2 2 3 3 1 3 3 1 1 3 3 2 2 3 3 3 2 3 2 1 1 3 1 3 2 3 2 2 2 1 2 2 1 1 3 2 1 1 3 1 2 3 2 1 3 2 2 1 3 2 1 2 3 2 1 2 2 2 3 1 1 2 2 3 2 3 3...

output:

175
118
279
482
208
59
2
210
44
352
188
87
364
62
155
134
10
1860
418
227

result:

ok 20 lines

Test #118:

score: 10
Accepted
time: 2ms
memory: 7736kb

input:

100
75
2 1 1 3 3 3 2 1 2 3 1 3 1 2 3 1 1 3 2 2 2 3 1 3 2 1 2 3 2 2 1 1 3 1 1 3 3 2 1 2 3 3 1 1 2 2 3 2 1 2 3 3 1 3 1 3 1 2 3 1 3 2 2 2 2 3 1 2 3 3 3 3 1 2 2
130
3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3...

output:

34
114
22
85
85
8
102
19
93
18
30
41
60
17
2
91
204
35
35
16
64
3
2
20
18
27
17
29
47
31
13
11
10
13
36
4
117
22
1
65
13
2
6
24
106
67
1
64
33
206
1
45
14
2
32
304
74
2
21
5
68
25
53
18
93
55
2
54
109
20
25
163
130
35
35
23
9
113
30
77
108
203
18
9
33
47
9
1
44
33
3
204
98
158
3
173
254
3
59
20

result:

ok 100 lines

Test #119:

score: 10
Accepted
time: 2ms
memory: 11920kb

input:

1
10000
2 2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 ...

output:

7601

result:

ok single line: '7601'

Test #120:

score: 10
Accepted
time: 2ms
memory: 10104kb

input:

1
10000
1 2 3 1 2 2 1 2 2 3 1 1 2 3 3 1 2 3 1 2 3 3 1 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 2 3 1 2 3 ...

output:

7746

result:

ok single line: '7746'

Test #121:

score: 10
Accepted
time: 2ms
memory: 11736kb

input:

1
10000
3 2 3 3 2 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 ...

output:

8313

result:

ok single line: '8313'

Subtask #5:

score: 10
Accepted

Dependency #4:

100%
Accepted

Test #122:

score: 10
Accepted
time: 31ms
memory: 25556kb

input:

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

output:

166092

result:

ok single line: '166092'

Test #123:

score: 10
Accepted
time: 32ms
memory: 26668kb

input:

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

output:

150827

result:

ok single line: '150827'

Test #124:

score: 10
Accepted
time: 31ms
memory: 24244kb

input:

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

output:

178728

result:

ok single line: '178728'

Test #125:

score: 10
Accepted
time: 30ms
memory: 24172kb

input:

1
200000
4 7 1 7 1 1 7 4 7 4 1 7 4 1 7 1 4 7 1 7 7 1 1 7 4 4 7 4 7 1 4 7 4 1 7 7 1 4 1 7 1 7 7 4 1 4 4 4 1 4 7 4 7 1 7 1 7 1 7 4 1 7 4 7 4 7 4 7 1 4 1 4 7 7 4 7 1 7 7 1 4 1 7 1 4 7 1 4 7 7 4 1 1 7 4 7 1 7 1 7 1 1 7 1 7 4 7 7 1 7 4 1 7 1 4 7 4 7 1 4 7 1 4 1 4 1 7 1 1 7 4 7 4 1 7 4 1 7 1 4 7 1 7 1 7 4...

output:

95820

result:

ok single line: '95820'

Test #126:

score: 10
Accepted
time: 33ms
memory: 24048kb

input:

1
200000
10 7 2 10 2 10 2 7 10 2 2 10 10 10 2 10 2 7 7 7 2 10 7 2 10 7 2 7 10 7 10 7 10 2 10 7 2 2 7 2 10 7 2 7 2 7 2 7 2 10 7 10 2 7 2 10 7 10 7 2 2 10 2 10 7 10 2 2 7 10 7 2 2 10 2 7 10 7 10 2 10 2 7 10 7 2 2 2 10 7 2 7 2 10 2 7 10 7 2 10 2 10 7 2 7 10 7 2 10 7 10 2 2 10 2 10 2 10 2 10 2 7 2 7 10 ...

output:

87271

result:

ok single line: '87271'

Test #127:

score: 10
Accepted
time: 28ms
memory: 26672kb

input:

1
200000
1 6 1 6 1 6 10 1 10 1 10 1 1 6 1 10 6 10 1 6 1 10 6 1 6 10 6 10 10 1 10 10 6 1 10 1 6 10 6 10 6 10 6 10 6 10 1 10 6 10 6 1 10 6 10 6 10 6 6 10 6 10 1 1 6 10 1 10 6 10 6 1 10 1 6 10 6 1 6 1 10 1 10 6 1 10 1 6 10 6 1 6 6 10 6 1 1 6 1 6 10 1 6 1 10 1 1 6 1 10 1 1 10 6 10 10 6 10 1 10 1 10 6 10...

output:

95918

result:

ok single line: '95918'

Test #128:

score: 10
Accepted
time: 25ms
memory: 26672kb

input:

1
200000
10 9 10 9 10 9 10 9 10 9 10 9 10 9 10 3 9 3 9 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 10 6 3 10 3 10 3 10 3 10 3 3 10 3 10 3 10 3 10 3 10 3 10 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 3 1 ...

output:

16019

result:

ok single line: '16019'

Test #129:

score: 10
Accepted
time: 28ms
memory: 25672kb

input:

1
200000
4 5 4 5 4 5 4 4 5 6 5 4 5 6 4 6 4 6 4 6 4 6 6 4 6 4 6 4 6 4 6 4 6 4 6 4 6 4 6 6 4 6 4 6 4 6 4 4 6 4 6 4 6 6 8 6 6 4 4 8 6 4 8 6 4 8 4 8 4 4 8 8 4 8 4 8 4 8 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 4 8 4 8 4 8 4 8 4 8 4 8 4 8 8 4 8 4 8 4 8 4 8 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 4...

output:

14313

result:

ok single line: '14313'

Test #130:

score: 10
Accepted
time: 26ms
memory: 24704kb

input:

1
200000
5 3 5 3 5 3 5 1 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 3 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 6 5 3 5 6 3 5 6 3 6 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 10 3 5 3 10 3 10 3 10 3 10 3 10 3 10 3 10 3 10 3 10 3 10 10 3 10 10 3 10 3 10 3 10 3 10 3 3 10 3 10 3 10 3 10 3 10 3 10 3 10 3 10 3 10 ...

output:

15513

result:

ok single line: '15513'

Test #131:

score: 10
Accepted
time: 23ms
memory: 25820kb

input:

1
200000
7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 1 7 3 7 10 3 10 9 10 3 10 9 10 3 10 9 10 3 10 9 10 3 ...

output:

149344

result:

ok single line: '149344'

Test #132:

score: 10
Accepted
time: 25ms
memory: 26668kb

input:

1
200000
8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 10 8 4 8 1...

output:

149377

result:

ok single line: '149377'

Test #133:

score: 10
Accepted
time: 24ms
memory: 25752kb

input:

1
200000
2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 8 2 9 2 3 9 3 1 3 9 3 1 3 9 3...

output:

149345

result:

ok single line: '149345'

Test #134:

score: 10
Accepted
time: 30ms
memory: 26604kb

input:

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

output:

25620

result:

ok single line: '25620'

Test #135:

score: 10
Accepted
time: 27ms
memory: 26668kb

input:

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

output:

25827

result:

ok single line: '25827'

Test #136:

score: 10
Accepted
time: 30ms
memory: 25752kb

input:

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

output:

25640

result:

ok single line: '25640'

Test #137:

score: 10
Accepted
time: 31ms
memory: 26784kb

input:

1
200000
5 6 4 6 4 4 5 6 5 6 5 4 5 6 6 5 4 6 4 5 4 5 5 4 5 4 6 4 6 4 6 5 4 6 4 6 5 6 4 5 6 4 5 6 5 6 5 4 5 4 6 4 5 5 5 4 5 4 5 4 5 4 6 4 6 5 6 5 5 4 6 5 6 5 5 6 5 8 4 6 8 4 6 4 4 8 4 6 8 6 4 8 4 6 6 8 6 8 4 8 4 8 4 6 4 6 8 4 8 4 8 6 6 8 6 8 6 4 8 8 6 8 8 4 6 4 8 4 6 8 4 8 4 8 6 4 8 6 8 6 4 6 4 8 4 4...

output:

54939

result:

ok single line: '54939'

Test #138:

score: 10
Accepted
time: 24ms
memory: 25960kb

input:

1
200000
4 3 4 3 4 3 4 3 4 3 4 4 3 4 4 3 9 3 9 3 9 3 9 3 9 3 10 9 3 10 3 9 3 10 3 9 3 10 3 10 3 10 3 10 3 10 3 10 3 10 3 10 3 3 10 3 10 3 10 3 10 3 10 3 10 10 3 3 8 3 10 3 8 3 10 3 8 10 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 10 8 8 10 8 10 8 10 8 10 8 10 8 10...

output:

50710

result:

ok single line: '50710'

Test #139:

score: 10
Accepted
time: 31ms
memory: 25748kb

input:

1
200000
6 10 2 10 2 10 6 2 2 10 10 2 10 6 2 6 2 10 6 2 6 10 6 10 6 2 6 2 6 10 2 6 10 6 2 10 2 2 10 2 10 6 10 6 2 10 6 2 6 10 6 2 10 6 6 2 6 10 10 6 10 10 6 10 6 2 10 2 6 2 10 2 10 6 10 2 10 6 10 6 2 6 10 2 10 2 6 10 2 6 2 10 2 10 2 6 10 2 6 10 6 10 4 10 4 4 2 10 4 10 4 10 2 10 4 2 2 10 4 10 2 4 10 ...

output:

51364

result:

ok single line: '51364'

Test #140:

score: 10
Accepted
time: 36ms
memory: 14956kb

input:

5
31438
7 5 5 3 5 3 3 7 5 1 7 4 4 4 4 2 2 7 3 3 1 2 2 7 2 4 7 3 4 6 7 1 1 4 3 4 4 3 3 3 1 4 3 1 3 7 3 6 1 4 4 7 4 6 6 6 7 4 6 4 1 1 2 7 6 2 3 4 3 4 2 2 3 4 6 3 2 2 1 3 6 2 4 4 7 2 5 5 3 5 3 5 6 5 5 4 5 5 4 2 5 5 7 2 5 6 2 6 6 6 6 6 2 7 7 5 1 1 5 3 6 5 7 6 1 4 3 5 4 4 6 7 7 4 7 1 6 7 6 2 2 3 4 1 6 1 ...

output:

22591
34465
68516
25897
380

result:

ok 5 lines

Test #141:

score: 10
Accepted
time: 31ms
memory: 15020kb

input:

5
80502
3 1 7 1 3 1 3 7 3 7 1 3 1 3 1 7 3 1 3 1 1 7 3 7 3 1 3 1 3 7 3 1 7 1 3 1 7 1 7 1 7 1 7 1 7 1 3 7 3 1 3 7 1 3 7 3 1 3 7 3 7 3 7 3 7 1 3 7 3 1 7 1 3 7 3 7 1 7 1 3 1 7 3 1 3 7 3 7 3 3 7 3 1 7 1 7 3 3 7 1 7 1 3 1 3 1 1 7 1 3 7 1 3 7 1 7 3 1 7 3 1 7 3 7 3 7 1 7 3 7 3 7 1 3 1 3 7 1 3 1 7 3 1 7 1 7 ...

output:

39267
6856
16735
26256
6758

result:

ok 5 lines

Test #142:

score: 10
Accepted
time: 21ms
memory: 18280kb

input:

5
39449
3 5 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 3 3 3 5 3 5 3 5 3 3 5 3 3 5 1 5 5 3 3 5 3 5 5 5 3 5 3 5 3 5 3 5 5 3 5 3 5 5 3 3 3 5 3 5 3 5 3 5 3 5 3 5 3 5 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 ...

output:

2639
3386
4659
334
2110

result:

ok 5 lines

Test #143:

score: 10
Accepted
time: 23ms
memory: 20396kb

input:

5
5953
1 5 1 4 1 5 1 4 1 5 1 4 1 5 1 4 1 5 1 4 1 5 1 4 1 5 1 4 1 5 1 3 5 3 2 3 5 3 2 3 5 3 7 5 7 6 7 5 7 6 7 5 7 1 5 1 2 1 5 1 2 1 5 1 2 1 5 1 6 5 6 7 6 5 6 2 5 2 4 2 5 2 4 2 5 2 4 2 5 2 4 2 5 2 4 2 5 2 4 2 5 2 4 2 5 2 4 2 5 2 4 2 5 2 4 2 5 2 1 5 1 7 1 5 1 7 1 5 1 4 5 4 3 4 5 4 3 4 5 4 7 5 7 2 7 5 7...

output:

4159
17937
96620
8083
21726

result:

ok 5 lines

Test #144:

score: 10
Accepted
time: 28ms
memory: 16172kb

input:

5
26964
2 5 2 5 2 5 2 2 5 5 2 5 2 5 2 5 2 5 2 5 2 6 6 2 6 2 2 6 2 6 2 6 2 6 2 2 1 2 3 2 3 2 3 2 7 7 2 7 2 2 7 7 2 7 2 7 2 7 2 7 7 2 7 7 2 7 1 7 4 4 7 6 6 7 6 6 7 6 7 6 7 7 6 6 6 6 7 6 7 6 7 6 7 6 7 7 6 7 6 2 6 2 6 2 6 2 2 6 6 2 6 2 2 6 2 6 2 6 2 6 2 6 2 6 2 6 2 2 6 2 6 2 6 2 2 6 2 6 2 6 2 6 6 2 6 2 ...

output:

3054
7918
8088
1992
2731

result:

ok 5 lines

Test #145:

score: 10
Accepted
time: 28ms
memory: 19532kb

input:

5
10441
5 6 5 6 5 6 5 6 5 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 4 6 4 6 4 6 4 6 4 6 4 6 4 6 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 7 7 7 6 7 6 7 6 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 4 7 4 7 4 7 ...

output:

2228
2939
7794
2791
17974

result:

ok 5 lines

Test #146:

score: 10
Accepted
time: 31ms
memory: 14128kb

input:

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

output:

51801
44778
7029
3998
50014

result:

ok 5 lines

Test #147:

score: 10
Accepted
time: 28ms
memory: 24708kb

input:

5
165460
6 7 4 7 4 7 4 7 7 6 7 7 4 7 6 7 4 7 7 4 6 6 4 6 7 6 4 6 4 6 7 6 4 7 6 4 7 4 6 7 4 6 6 4 7 6 7 4 7 6 4 6 7 4 7 4 6 6 4 4 6 7 7 4 6 4 7 4 4 4 7 4 7 4 4 6 7 4 7 4 4 7 7 6 4 7 6 7 4 8 6 8 4 6 6 8 8 8 4 8 4 4 6 4 6 4 8 4 8 6 4 8 6 4 6 8 4 6 8 6 4 6 8 4 8 4 6 8 6 8 4 8 6 4 6 8 4 6 4 6 4 6 4 4 6 4...

output:

71565
12332
1267
1638
987

result:

ok 5 lines

Test #148:

score: 10
Accepted
time: 24ms
memory: 14316kb

input:

5
21146
9 3 9 9 9 3 8 3 3 9 3 8 3 9 3 3 3 9 3 9 3 9 3 9 5 3 9 5 9 3 9 5 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 5 9 5 9 5 9 5 9 5 5 9 5 9 5 9 5 9 5 5 9 5 9 9 9 5 9 5 9 9 5 9 5 5 9 5 9 5 9 5 9 5 9 9 5 9 5 9 9 5 9 5 9 5 9 5 9 9 5 9 5 9 5 5 9 5 9 5 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 5 9 5 9 5 ...

output:

1582
4002
3180
2214
3804

result:

ok 5 lines

Test #149:

score: 10
Accepted
time: 27ms
memory: 16836kb

input:

5
27833
8 3 8 7 8 3 8 7 8 3 8 7 8 3 8 7 8 3 8 7 8 3 8 7 8 3 8 7 8 3 8 7 8 3 8 7 8 3 8 7 8 3 8 7 8 3 8 7 8 3 8 10 3 10 1 10 3 10 1 10 3 10 1 10 3 10 1 10 3 10 1 10 3 10 1 10 3 10 1 10 3 10 6 3 6 7 6 3 6 1 3 1 10 1 3 1 10 1 3 1 10 1 3 1 10 1 3 1 10 1 3 1 10 1 3 1 7 3 7 6 7 3 7 6 7 3 7 6 7 3 7 6 7 3 7 ...

output:

20420
5045
74592
21902
26524

result:

ok 5 lines

Test #150:

score: 10
Accepted
time: 25ms
memory: 14324kb

input:

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

output:

7432
3252
8288
5140
448

result:

ok 5 lines

Test #151:

score: 10
Accepted
time: 28ms
memory: 14888kb

input:

5
17501
3 1 3 7 3 1 3 7 1 7 1 3 7 3 7 3 7 1 1 7 1 3 1 3 1 7 1 7 3 1 3 7 3 7 1 7 3 7 1 3 1 7 1 3 7 3 7 1 3 7 3 7 3 1 3 1 3 7 1 7 1 7 3 7 3 1 3 7 3 7 1 3 7 3 1 3 7 3 7 1 7 1 7 1 7 3 1 7 3 1 7 1 7 1 3 7 7 3 1 3 7 1 7 1 3 1 3 3 7 1 3 7 1 7 3 1 3 1 7 3 7 1 3 1 7 3 7 3 7 1 7 7 3 7 3 7 3 1 7 3 7 1 3 7 1 3 ...

output:

9594
22507
2017
9617
53924

result:

ok 5 lines

Test #152:

score: 10
Accepted
time: 26ms
memory: 12632kb

input:

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

output:

15570
5273
1147
2125
9270
22092
29594
32800
7667
35158

result:

ok 10 lines

Test #153:

score: 10
Accepted
time: 30ms
memory: 15092kb

input:

10
1409
5 7 5 7 5 7 5 7 4 4 5 4 5 7 4 5 5 7 5 5 7 4 7 5 7 5 4 7 4 4 5 7 4 5 4 5 4 5 4 5 4 5 7 5 4 7 7 5 7 5 7 5 4 5 7 5 7 5 4 5 4 7 4 7 5 4 5 4 7 5 4 7 5 4 4 7 5 4 5 4 5 4 7 5 4 5 7 5 7 7 5 4 7 4 4 7 5 4 4 7 4 7 5 7 4 7 5 7 4 5 7 4 7 5 4 5 4 7 4 7 5 7 4 7 5 7 5 7 4 7 5 4 5 4 5 4 5 7 4 5 4 5 7 4 5 7 ...

output:

650
35953
5072
9541
12804
3615
2850
2157
6906
13231

result:

ok 10 lines

Test #154:

score: 10
Accepted
time: 28ms
memory: 12320kb

input:

10
3068
5 9 5 9 5 9 5 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 9 5 9 7 5 3 7 3 5 3 3 7 3 7 3 7 3 7 3 7 3 7 7 3 7 3 7 3 7 3 7 3 7 3 7 3 7 3 3 7 3 7 3 7 7 3 7 3 7 3 7 3 7 3 10 7 10 7 10 7 10 7 10 7 10 7 10 7 10 7 10 7 10 7 10 5 10 5 10 5 10 5 10 5 10 5 10 5 10 5 5 10 5 10 5 10 5 10 5 10 5 10 5 10 5 10 5 ...

output:

204
2149
1155
1115
991
3692
1579
2168
678
1240

result:

ok 10 lines

Test #155:

score: 10
Accepted
time: 27ms
memory: 14136kb

input:

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

output:

1282
2046
23379
6663
35969
40360
8461
620
3104
24727

result:

ok 10 lines

Test #156:

score: 10
Accepted
time: 28ms
memory: 12796kb

input:

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

output:

4227
1111
981
2894
1608
4548
8530
144
851
759

result:

ok 10 lines

Test #157:

score: 10
Accepted
time: 26ms
memory: 12224kb

input:

10
19664
8 3 8 3 8 3 8 3 8 3 6 3 6 3 6 3 6 3 6 3 6 10 6 10 6 10 10 6 10 6 1 2 10 2 10 1 6 1 1 6 1 6 1 4 4 1 4 1 4 1 4 1 4 1 1 4 2 4 2 4 2 4 2 4 2 4 2 4 3 4 3 4 3 4 4 3 4 3 4 3 4 3 4 4 3 4 3 8 3 8 3 8 3 3 8 8 3 8 3 8 3 8 3 8 3 8 8 3 8 3 8 3 8 3 8 3 8 3 8 8 3 8 3 8 8 3 10 3 10 10 3 10 3 10 3 10 3 10 3...

output:

7234
1736
6467
9165
5296
3407
1844
9426
2596
7120

result:

ok 10 lines

Test #158:

score: 10
Accepted
time: 33ms
memory: 11940kb

input:

40
4659
1 5 5 5 5 9 7 10 9 6 9 9 1 8 6 3 7 5 1 3 3 5 6 4 1 3 8 9 7 3 4 3 3 4 5 6 1 2 4 6 6 10 8 10 6 2 1 8 8 3 10 9 9 8 2 1 7 10 2 5 7 5 4 9 6 3 1 1 9 3 2 3 9 1 6 6 10 1 4 2 8 5 3 5 8 2 9 1 8 7 9 1 7 5 2 4 1 7 9 4 7 4 8 4 2 10 1 4 6 9 7 3 4 1 5 1 5 5 6 2 4 5 7 5 9 5 6 3 8 6 4 2 6 8 7 1 7 5 1 1 10 5 ...

output:

3618
1638
4366
1145
5820
3172
3021
558
4339
396
2287
10199
3959
38
7014
4576
2299
19022
1055
7055
7479
1830
1052
163
5597
722
8599
4688
1579
2200
917
5032
11201
6255
11268
1614
3637
1408
3632
1630

result:

ok 40 lines

Test #159:

score: 10
Accepted
time: 26ms
memory: 12100kb

input:

40
2659
3 4 2 4 3 2 3 4 3 2 4 3 2 3 4 4 4 3 2 4 2 3 2 4 3 2 3 2 3 2 4 2 3 4 3 4 2 4 2 3 2 3 4 2 4 2 4 3 2 3 2 4 2 4 3 2 4 4 2 4 3 2 3 2 3 4 3 2 3 4 3 2 3 2 4 3 4 3 2 3 4 2 4 3 2 4 3 4 3 2 4 3 4 2 3 4 3 4 4 3 4 3 2 4 2 3 2 3 4 2 3 4 2 3 4 2 3 4 2 3 2 3 2 4 3 4 3 4 2 2 2 4 2 3 2 4 4 2 4 2 4 2 3 2 4 3 ...

output:

1299
3684
2696
1494
153
400
2888
1651
4821
1622
3710
2502
377
2776
4960
457
1825
789
3808
1993
799
454
209
2305
1958
3720
8738
4637
2076
1025
2831
2262
5457
2709
3114
2917
1749
1823
1335
158

result:

ok 40 lines

Test #160:

score: 10
Accepted
time: 28ms
memory: 13940kb

input:

40
5834
8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 8 9 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 6 8 8 1 6 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 8 1 8 1 8 1 8 1 8 1 1 8 7 8 7 8 7 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 8 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 7 8 ...

output:

434
106
610
887
283
258
55
456
285
983
110
427
119
241
496
93
1178
702
31
102
24
168
222
305
556
779
423
469
24
10
339
302
266
230
114
850
1263
15
179
282

result:

ok 40 lines

Test #161:

score: 10
Accepted
time: 26ms
memory: 11924kb

input:

40
18191
8 3 8 2 8 3 8 2 8 3 8 4 3 4 7 4 3 4 7 4 3 4 7 4 3 4 7 4 3 4 6 3 6 5 6 3 6 2 3 2 4 2 3 2 4 2 3 2 4 2 3 2 4 2 3 2 4 2 3 2 4 2 3 2 7 3 7 5 7 3 7 5 7 3 7 5 7 3 7 5 7 3 7 5 7 3 7 5 7 3 7 5 7 3 7 5 7 3 7 1 3 1 9 1 3 1 9 1 3 1 2 3 2 7 2 3 2 7 2 3 2 7 2 3 2 7 2 3 2 4 3 4 10 4 3 4 10 4 3 4 10 4 3 4 ...

output:

13161
538
5394
20556
822
3427
5646
4931
6727
794
3928
370
5593
12003
2195
1924
62
440
245
9001
84
2626
2679
147
2330
6373
482
1514
1161
877
2247
10013
2381
1737
1489
4311
251
1927
610
1601

result:

ok 40 lines

Test #162:

score: 10
Accepted
time: 24ms
memory: 11932kb

input:

40
3170
6 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 7 1 4 1 4 1 4 3 4 3 4 3 4 3 4 3 4 3 4 3 3 4 3 4 3 4 3 4 3 4 4 3 4 3 4 3 4 3 4 3 4 4 3 4 3 4 3 10 10 3 10 3 6 6 3 6 3 6 3 6 7 6 7 6 7 6 5 7 5 7 5 7 5 7 5 7 5 7 5 7 5 7 5 7 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 9 2 9 2...

output:

450
402
1042
824
242
747
659
874
174
890
834
502
38
916
538
754
96
823
161
116
748
712
707
2174
1107
1914
600
504
988
285
887
945
868
18
493
242
641
100
145
283

result:

ok 40 lines

Test #163:

score: 10
Accepted
time: 22ms
memory: 12672kb

input:

40
2690
1 9 9 8 10 9 8 9 8 9 10 8 1 9 1 9 1 9 1 10 9 1 9 10 1 10 9 10 9 10 9 10 1 9 10 9 1 9 10 9 1 9 10 9 6 1 6 9 1 9 6 9 1 6 1 6 1 6 1 6 9 1 6 9 1 6 1 9 1 6 1 9 1 6 9 1 6 9 6 1 6 1 1 6 9 6 9 6 9 6 1 6 9 6 1 6 9 6 9 1 9 6 1 6 7 4 3 4 3 7 3 4 4 7 3 7 4 6 10 6 10 6 10 6 10 6 10 6 6 10 6 10 6 10 6 10 ...

output:

923
1464
95
322
671
239
3698
18558
762
9990
2549
423
916
1475
315
373
12
885
73
720
3876
5412
520
1052
288
2425
2074
2425
144
5855
672
3722
2242
1376
784
3824
494
1019
244
4872

result:

ok 40 lines

Test #164:

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

input:

400
791
10 10 8 9 10 10 7 1 2 8 1 7 3 6 3 6 6 5 2 6 8 1 1 3 8 7 1 9 2 1 2 6 10 4 1 1 10 5 10 4 7 9 7 8 10 10 10 2 4 3 8 1 10 3 4 7 10 6 6 5 4 4 1 1 2 6 7 9 5 1 5 3 3 1 9 6 4 1 3 1 1 8 4 6 9 8 5 9 5 6 9 3 5 8 7 1 5 6 3 8 3 5 5 10 5 4 8 10 8 7 6 10 6 1 6 1 10 7 10 4 1 8 1 10 2 8 9 6 10 5 4 5 4 9 4 1 4...

output:

643
289
134
1604
167
111
466
676
2108
795
146
313
232
7
191
192
473
228
2
74
99
1514
489
6
161
654
631
20
539
380
89
201
370
24
469
267
1287
401
834
473
558
495
463
330
193
29
114
248
669
358
637
1113
15
2852
1159
179
90
168
74
761
120
312
810
15
1568
63
417
73
688
232
280
75
29
1917
496
33
113
163
...

result:

ok 400 lines

Test #165:

score: 10
Accepted
time: 26ms
memory: 7872kb

input:

400
523
1 3 6 1 6 3 1 1 6 3 6 3 1 3 1 3 8 3 1 8 1 3 8 1 3 8 1 3 8 3 8 4 8 3 6 8 6 6 3 8 6 8 3 6 8 8 6 8 3 2 6 2 6 6 3 6 3 2 3 2 3 6 2 6 2 6 3 2 3 2 6 4 3 4 6 4 4 3 4 6 4 3 6 6 3 6 4 3 6 4 3 4 3 6 4 3 4 6 3 4 6 3 4 3 3 6 8 3 8 4 3 4 3 4 10 3 4 3 10 10 4 4 10 4 10 6 10 3 6 3 10 6 3 10 3 10 3 10 6 10 6...

output:

255
9
390
100
25
233
183
264
43
523
430
90
61
56
176
16
727
117
312
81
142
14
19
173
60
172
6
430
169
623
44
107
222
1
238
694
73
82
246
586
42
436
544
11
155
121
140
706
94
122
421
8
245
161
441
169
167
461
200
416
728
192
18
95
16
158
450
477
78
327
37
782
465
252
394
1034
55
227
343
128
555
901
4...

result:

ok 400 lines

Test #166:

score: 10
Accepted
time: 24ms
memory: 11772kb

input:

400
5
8 1 8 1 8
374
5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 1 1 5 1 5 1 1 5 5 1 5 5 5 1 5 1 5 1 1 5 5 1 5 1 1 5 1 5 5 1 1 5 1 5 1 5 1 5 1 5 5 1 5 1 5 1 5 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 5 1 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 1 1 5 1 5 1 5 1 5 1 5 1 5 1 ...

output:

2
22
80
11
4
24
84
65
80
70
26
143
80
149
74
79
29
4
2
23
22
76
57
19
84
19
12
87
31
8
62
2
15
101
25
99
18
9
16
20
31
9
10
12
2
48
19
36
68
8
53
12
4
66
57
30
41
4
22
27
10
40
113
59
9
19
31
2
19
93
13
6
11
28
54
67
10
105
6
7
28
28
4
91
142
12
49
11
24
2
4
2
32
2
4
21
2
51
6
7
7
37
53
4
36
24
10
8...

result:

ok 400 lines

Test #167:

score: 10
Accepted
time: 26ms
memory: 7848kb

input:

400
709
1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 2 1 4 1 5 4 5 8 5 4 5 8 5 4 5 8 5 4 5 8 5 4 5 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 10 3 4 3 6 4 6 1 6 ...

output:

516
572
72
375
376
83
167
383
97
622
11
148
1178
957
538
81
9
49
386
677
364
735
225
320
807
233
34
216
1991
135
702
17
7
76
12
531
656
1024
662
474
98
674
62
100
296
618
123
1438
307
622
214
529
135
684
101
1100
84
378
42
275
61
1417
138
716
1166
388
72
45
479
604
335
2
965
142
89
216
72
480
821
63...

result:

ok 400 lines

Test #168:

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

input:

400
699
8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 8 2 4 2 4 2 4 2 4 2 9 2 9 10 9 10 9 10 5 10 5 10 5 10 5 10 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 1 8 6 8 6 9 6 9 6 9 6 9 4 9 4 9 4 9 4 9 4 9 4 9 4 9 4 9 4 9 4 9 4 9 4 3 4 3 4 3 3 4 9 4 9 4 9 4 8 4 8 4...

output:

90
225
83
19
24
69
33
159
62
41
43
23
59
52
8
16
17
62
35
231
88
14
42
54
40
86
25
93
158
24
21
34
33
57
20
42
241
206
60
17
87
3
205
28
33
113
70
25
13
58
4
31
165
52
56
7
20
34
27
26
94
41
32
52
22
69
33
11
122
21
7
20
4
124
6
85
39
47
38
1
61
66
34
122
219
34
47
9
48
60
29
24
68
45
49
30
32
11
63...

result:

ok 400 lines

Test #169:

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

input:

400
801
10 3 10 3 10 3 10 10 3 3 10 3 10 3 10 3 10 3 10 7 6 7 6 7 6 6 7 6 7 6 7 6 7 7 4 6 7 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 6 7 6 7 6 7 6 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 1 7 4 6 1 7 1 6 7 6 1 7 6 1 6 7 7 6 6 6 7 6 7 6 7 6 7 6 4 6 4 4 6 4 6 4 6 4 4 6 6 4 6 4 3 9 4 9 4 9 4 9 4 9 4 9 4 9 4 9 4 9 4 9 ...

output:

118
413
269
126
612
16
243
73
57
221
165
223
201
16
35
77
758
46
198
52
89
188
8
9
51
89
14
30
152
103
4
6
230
263
47
251
241
159
60
22
47
18
25
203
83
73
116
16
306
357
71
338
149
38
49
33
598
95
36
376
290
990
307
56
29
58
174
69
56
251
62
94
12
209
103
129
199
220
7
497
77
220
152
44
24
21
33
379...

result:

ok 400 lines

Test #170:

score: 10
Accepted
time: 39ms
memory: 11812kb

input:

5000
5
6 4 9 6 1
86
6 7 7 6 6 8 3 6 5 7 4 2 10 3 4 5 4 10 5 7 4 4 6 5 1 3 8 8 7 8 7 8 7 1 3 4 5 6 4 9 3 1 2 1 5 9 2 3 9 6 8 5 5 10 1 8 1 4 5 9 9 3 5 8 5 8 7 10 8 4 8 9 9 5 4 9 6 4 6 6 3 4 5 5 7 4
136
4 7 1 1 3 2 1 10 6 8 4 8 1 2 1 8 7 8 1 3 1 8 6 1 6 8 7 9 8 3 2 7 10 7 9 6 7 3 10 7 9 10 9 2 9 4 9 4 ...

output:

5
64
117
18
34
56
16
44
28
31
38
16
49
31
71
16
17
57
87
9
5
6
148
26
9
17
24
70
6
1
6
88
29
3
82
76
30
91
24
44
29
14
22
14
13
11
5
15
14
23
2
31
17
12
29
12
111
18
19
19
18
12
32
25
7
19
12
68
32
14
10
10
28
9
54
23
14
22
25
10
11
15
36
25
41
6
25
50
25
8
23
39
34
30
20
9
9
39
46
22
3
8
15
8
7
17
...

result:

ok 5000 lines

Test #171:

score: 10
Accepted
time: 24ms
memory: 11896kb

input:

5000
77
4 3 4 2 3 4 2 3 2 10 10 3 2 3 3 10 2 10 2 10 2 10 3 10 2 3 2 10 3 2 10 2 3 10 7 2 10 2 7 2 10 2 7 2 10 2 7 10 2 10 7 1 10 1 10 1 1 7 1 7 10 1 10 1 10 7 1 7 1 7 8 1 2 1 5 2 1
6
2 3 5 5 2 3
15
1 4 4 1 4 9 4 9 4 9 4 9 9 4 9
29
1 8 3 3 8 8 9 3 9 8 3 8 9 9 3 9 3 9 8 3 8 9 3 9 3 9 8 8 9
89
10 7 2 ...

output:

46
5
4
13
60
73
1
24
16
18
29
28
22
7
60
14
8
6
68
58
8
25
42
42
7
63
65
3
5
27
24
77
40
59
13
33
40
1
3
30
8
28
41
30
30
16
49
7
50
15
18
31
11
18
6
8
13
8
3
21
22
19
13
5
11
8
11
6
6
33
37
20
1
10
5
19
36
52
13
14
40
27
11
26
6
73
25
5
1
15
13
2
13
23
14
25
11
2
5
11
9
2
41
10
41
3
35
41
6
10
9
18...

result:

ok 5000 lines

Test #172:

score: 10
Accepted
time: 32ms
memory: 11828kb

input:

5000
9
5 8 5 8 5 8 5 8 5
9
7 2 7 2 7 2 7 2 7
81
6 7 6 7 6 7 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7 6 7
76
3 5 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 5 3 5 3 5 3 5 5 3 5 3 5 3 5 3...

output:

2
2
2
2
2
2
8
2
2
2
7
11
2
2
2
10
2
4
2
9
9
18
6
1
2
5
5
7
6
2
2
2
2
2
9
2
2
2
14
2
2
25
1
19
10
13
11
11
2
2
23
2
1
2
2
4
6
2
1
1
20
2
14
2
2
2
14
7
2
2
7
2
2
2
2
2
7
2
2
16
14
2
6
2
9
2
21
4
2
5
2
2
5
4
6
2
1
13
2
2
24
9
2
2
13
2
2
6
2
4
2
1
10
5
2
2
5
5
2
11
2
2
2
2
1
2
6
12
4
13
5
8
2
2
12
10
2
...

result:

ok 5000 lines

Test #173:

score: 10
Accepted
time: 30ms
memory: 7740kb

input:

5000
109
9 6 9 1 9 6 9 2 6 2 10 2 6 2 5 6 5 9 5 6 5 9 5 6 5 3 10 3 2 3 10 3 2 3 10 3 2 3 10 3 2 3 10 3 9 10 9 7 9 10 9 7 9 10 9 7 9 10 9 7 9 10 9 7 9 10 9 7 9 10 9 7 9 10 9 7 9 10 9 7 9 10 9 3 10 3 4 3 10 3 4 3 10 3 1 10 1 6 1 10 1 6 1 10 1 6 1 10 1
20
9 2 5 7 10 10 2 3 2 2 8 4 9 7 2 6 6 5 1 2
35
10...

output:

78
16
25
6
3
19
48
15
7
13
28
7
5
36
48
8
10
85
49
44
2
3
16
21
25
65
26
91
23
2
81
34
17
28
19
16
15
4
15
79
6
18
5
27
44
10
30
35
54
13
26
35
143
19
27
27
2
22
11
31
32
63
4
14
55
59
28
16
31
7
43
46
34
2
45
41
10
53
18
64
11
50
49
14
52
28
50
2
36
8
42
12
39
8
25
1
176
6
9
47
48
17
5
21
35
5
23
1...

result:

ok 5000 lines

Test #174:

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

input:

5000
8
8 5 8 2 3 2 3 2
11
4 9 4 9 4 9 4 9 4 6 4
68
6 1 6 1 6 1 6 1 6 1 6 2 6 2 6 2 6 6 6 2 6 2 6 2 6 5 6 5 5 6 5 6 5 6 5 6 5 6 6 5 6 5 6 5 6 2 6 2 6 2 6 6 2 6 6 2 6 2 6 2 6 2 6 2 6 2 1 2
42
9 10 9 10 9 10 9 10 9 5 9 5 9 5 9 5 5 5 5 9 5 9 5 9 5 9 5 9 5 9 5 4 5 4 5 4 5 5 4 5 4 4
8
6 10 6 10 1 10 1 10
...

output:

4
4
9
6
4
9
10
9
3
3
1
1
6
2
2
5
10
9
4
7
4
2
6
10
4
2
18
3
3
2
4
2
6
13
6
11
4
19
9
4
4
14
10
2
2
2
6
4
3
2
4
6
2
12
1
5
16
24
16
5
6
2
6
2
3
4
3
2
2
2
8
9
2
2
8
2
2
10
2
11
7
2
9
2
13
3
4
9
14
11
6
15
5
7
4
24
21
7
17
6
2
2
2
10
4
8
4
4
17
9
3
2
2
4
2
3
7
4
2
2
3
2
2
4
10
7
2
12
20
15
2
2
6
11
4
4...

result:

ok 5000 lines

Test #175:

score: 10
Accepted
time: 37ms
memory: 13800kb

input:

5000
1
6
68
5 9 9 5 9 5 9 5 5 7 1 7 1 7 6 1 6 7 6 7 6 2 7 6 2 7 10 2 7 2 4 2 4 2 5 4 5 1 9 1 9 1 9 1 9 1 9 1 7 2 2 1 2 7 2 1 1 7 9 7 5 6 7 5 6 10 3 10
3
7 1 7
1
9
18
3 2 7 1 4 7 9 7 4 7 4 7 4 7 4 7 4 7
18
2 10 2 4 9 10 9 10 9 1 6 1 6 1 5 6 5 5
96
10 6 10 1 10 4 2 4 2 4 2 4 2 4 2 3 1 7 3 6 10 6 10 6 ...

output:

1
37
2
1
9
9
39
27
31
9
9
42
11
13
14
22
10
22
4
39
20
26
26
33
38
15
3
7
12
10
30
18
24
13
1
13
2
1
12
16
7
2
6
13
11
40
14
7
15
17
6
4
2
18
82
7
5
8
29
14
7
15
1
76
2
1
8
52
9
62
26
13
51
10
14
32
35
16
11
47
18
6
19
13
6
39
19
5
22
12
3
9
9
11
60
9
17
10
6
7
31
33
7
60
4
42
7
8
6
8
15
6
9
13
4
10...

result:

ok 5000 lines

Test #176:

score: 10
Accepted
time: 55ms
memory: 11756kb

input:

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

output:

2
9
2
2
3
3
1
2
4
6
6
1
3
2
1
7
6
1
7
4
4
2
6
9
1
4
1
3
4
2
4
1
5
6
1
1
3
10
2
23
3
3
4
10
1
9
1
4
4
4
4
4
1
13
2
1
11
1
3
2
4
5
1
3
7
2
5
7
3
1
3
1
6
1
7
1
2
2
2
7
4
8
4
2
3
1
4
12
3
3
1
1
1
4
8
1
20
15
3
1
20
1
2
4
2
4
3
1
2
10
10
5
10
1
1
5
3
8
5
8
1
5
1
8
5
5
11
3
2
4
1
2
8
9
2
3
4
4
3
1
4
4
5
3...

result:

ok 40000 lines

Test #177:

score: 10
Accepted
time: 43ms
memory: 7732kb

input:

40000
1
6
6
7 9 7 5 9 5
11
10 3 10 7 10 7 7 8 5 8 10
2
7 5
2
9 10
3
8 2 1
10
10 6 10 6 10 3 6 8 6 9
1
2
2
7 9
5
5 8 2 5 2
11
10 1 10 9 1 9 4 5 9 4 5
3
7 2 7
12
6 10 6 10 8 6 8 10 6 8 10 6
26
1 10 1 9 9 10 1 9 10 2 1 9 1 9 2 1 2 2 2 1 2 9 2 9 2 2
4
8 2 3 9
3
7 9 1
2
5 8
3
5 7 5
17
8 10 8 10 6 8 10 6 ...

output:

1
4
7
2
2
3
6
1
2
4
9
2
8
14
4
3
2
2
11
2
1
1
4
1
2
1
3
8
1
2
1
3
3
3
4
6
3
1
17
3
1
2
3
2
3
2
2
1
4
2
2
1
3
1
2
3
7
3
1
3
5
8
3
2
9
1
4
2
3
2
2
4
5
2
1
13
2
4
3
2
1
4
3
4
2
3
1
2
2
2
1
6
1
1
1
9
1
7
9
10
9
4
5
3
2
2
6
5
5
1
3
1
2
3
1
1
3
1
7
1
1
6
5
1
1
7
2
1
7
6
2
2
10
1
5
5
1
3
2
1
2
1
1
2
2
10
1...

result:

ok 40000 lines

Test #178:

score: 10
Accepted
time: 32ms
memory: 7740kb

input:

40000
8
5 5 3 5 3 5 3 5
9
1 6 1 6 1 1 6 1 6
1
2
8
3 4 3 4 3 3 4 3
2
4 5
1
1
2
4 7
1
3
1
2
2
4 5
1
3
2
5 3
3
3 5 3
2
7 5
2
7 2
3
6 1 6
8
1 5 1 7 5 7 5 7
1
9
6
3 5 3 5 3 5
1
10
4
9 8 9 8
9
9 8 9 8 9 8 9 8 9
2
9 2
2
1 10
4
9 8 9 8
10
7 7 5 7 5 7 5 7 5 7
9
1 7 1 7 1 7 1 7 1
11
1 4 1 4 1 4 1 4 4 1 4
2
1 ...

output:

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

result:

ok 40000 lines

Test #179:

score: 10
Accepted
time: 48ms
memory: 11828kb

input:

40000
18
5 4 3 8 1 5 8 8 5 2 8 4 5 7 1 3 5 3
2
4 10
4
5 7 5 10
5
1 5 6 3 2
1
4
7
8 1 1 3 4 3 4
2
4 3
7
7 1 9 2 4 8 3
2
5 8
18
2 10 9 8 2 5 4 8 10 5 3 1 8 4 10 6 5 2
3
8 6 9
5
7 5 8 2 9
2
9 3
1
3
4
2 7 1 6
16
5 2 4 1 7 2 6 8 9 3 10 8 10 3 2 6
1
4
11
7 4 9 9 7 2 4 5 9 3 4
2
3 8
6
5 10 6 5 4 10
7
1 8 2...

output:

14
2
3
5
1
4
2
7
2
18
3
5
2
1
4
15
1
10
2
6
6
1
2
3
4
1
1
8
1
1
4
7
2
3
2
14
3
1
1
5
15
3
1
6
2
2
1
5
3
4
2
3
5
1
1
11
5
5
7
2
6
1
1
8
2
10
6
2
1
6
4
2
4
5
2
5
1
3
1
3
7
2
4
10
14
2
2
3
7
5
9
2
5
5
2
2
3
1
5
11
1
2
4
2
7
6
1
3
2
1
4
3
4
2
7
3
5
6
7
3
5
3
1
4
3
1
3
9
1
1
2
2
2
1
3
4
2
1
4
18
1
3
5
1
...

result:

ok 40000 lines

Test #180:

score: 10
Accepted
time: 24ms
memory: 9844kb

input:

40000
6
6 3 6 3 6 3
1
1
2
1 5
3
1 6 1
2
3 4
2
2 3
2
4 5
2
1 8
1
6
5
1 8 1 8 1
13
2 10 2 10 2 10 10 2 10 2 10 2 10
2
7 3
6
7 6 7 1 7 1
3
8 7 8
3
10 9 10
1
9
8
9 4 9 4 9 4 9 9
4
10 5 10 5
5
6 4 6 4 6
15
4 10 4 10 4 4 10 4 10 4 4 10 4 10 4
10
7 1 7 1 7 1 7 1 7 7
6
3 8 3 8 3 3
10
4 4 3 4 10 4 10 4 10 4
...

output:

2
1
2
2
2
2
2
2
1
2
2
2
4
2
2
1
2
2
2
2
2
2
4
2
1
3
1
2
4
4
2
1
2
4
3
2
1
3
2
2
3
5
2
2
2
1
2
4
6
2
2
1
2
2
2
2
1
1
4
4
4
2
1
2
2
2
2
2
2
1
2
2
2
2
2
2
3
2
2
2
4
3
4
2
2
2
1
2
1
1
1
1
3
3
2
2
2
2
4
2
1
2
2
1
2
2
1
4
2
2
2
1
1
1
2
1
2
2
2
2
1
2
6
2
2
2
5
2
1
4
2
1
7
2
1
1
3
1
1
5
1
1
3
4
4
1
2
1
2
1
...

result:

ok 40000 lines

Test #181:

score: 10
Accepted
time: 44ms
memory: 11804kb

input:

40000
1
9
1
5
1
9
12
6 9 10 4 5 7 8 1 5 3 5 5
1
7
1
3
2
6 10
3
2 3 6
10
8 10 1 10 10 4 3 10 6 10
1
3
8
10 6 4 3 6 6 10 7
22
1 1 5 9 9 1 9 1 5 5 1 5 9 5 1 9 5 1 7 6 10 1
4
8 1 8 7
4
5 6 5 6
7
7 1 7 1 8 10 7
1
8
2
5 9
2
8 3
9
3 5 3 5 5 3 5 3 5
5
10 6 6 5 3
1
8
2
6 4
12
10 4 9 7 8 8 7 8 7 8 7 8
9
9 6 3...

output:

1
1
1
10
1
1
2
3
7
1
7
15
3
2
5
1
2
2
2
4
1
2
5
8
7
2
4
2
2
2
1
1
5
1
3
2
3
1
2
3
1
9
4
5
3
2
1
3
8
9
1
3
2
10
2
4
2
4
2
1
1
4
3
5
18
2
4
1
2
5
3
2
4
1
7
1
5
6
6
3
1
3
1
1
10
6
2
1
2
2
2
18
3
1
2
1
6
12
1
3
14
2
8
6
3
2
3
1
2
2
2
3
3
4
2
2
4
3
5
3
4
5
1
1
8
3
1
11
1
2
2
2
9
2
3
7
2
4
4
4
8
5
3
9
3
1...

result:

ok 40000 lines

Test #182:

score: 10
Accepted
time: 3ms
memory: 7860kb

input:

3
2397
5 1 7 7 5 5 5 2 6 1 6 2 5 2 2 7 7 2 1 3 5 7 5 3 4 2 5 2 5 6 5 1 7 5 3 7 2 6 7 3 3 1 2 3 4 7 2 7 3 6 6 6 5 2 6 7 4 7 5 3 6 5 7 6 2 1 1 1 4 1 6 7 3 4 1 7 7 2 7 7 2 6 1 1 7 6 6 2 1 3 2 3 3 4 1 6 7 2 3 2 2 2 5 3 1 7 4 5 7 4 2 3 4 7 3 3 5 7 3 6 7 3 4 7 4 6 1 6 2 6 2 6 2 4 6 6 3 6 2 5 5 7 4 5 1 3 6...

output:

1754
2724
3230

result:

ok 3 lines

Test #183:

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

input:

3
174
7 7 7 7 3 6 7 6 3 6 6 3 6 3 7 3 7 3 7 6 3 6 7 6 7 6 6 7 7 6 3 6 7 3 6 7 3 7 3 3 6 7 6 7 3 7 6 3 7 7 3 7 6 7 6 6 3 3 6 7 3 7 6 7 6 3 7 3 6 7 3 3 6 7 3 7 6 3 7 7 3 6 3 6 7 6 7 6 7 7 3 6 6 3 7 3 6 3 3 7 6 3 7 3 6 7 6 7 6 7 3 6 3 5 3 5 6 5 6 3 6 3 6 5 5 5 6 3 5 3 3 6 5 3 6 3 6 3 5 6 6 3 6 3 6 3 5 ...

output:

83
62
4581

result:

ok 3 lines

Test #184:

score: 10
Accepted
time: 2ms
memory: 11764kb

input:

3
2001
7 5 7 5 7 5 7 7 5 7 5 7 5 5 7 5 7 5 7 5 7 5 7 5 7 5 7 5 7 5 7 5 7 5 7 7 5 5 7 5 7 5 7 5 5 7 5 7 7 5 7 7 5 7 5 7 5 5 7 5 7 5 7 7 5 7 5 7 5 7 5 7 5 7 5 5 5 7 5 7 5 7 5 5 7 5 7 5 7 5 7 7 5 7 5 5 7 7 5 7 5 7 5 7 7 5 7 5 7 7 5 7 7 5 7 5 7 7 7 5 7 5 7 5 5 7 5 5 7 5 7 5 5 7 5 7 7 5 7 5 7 5 7 7 7 5 7...

output:

138
291
136

result:

ok 3 lines

Test #185:

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

input:

3
664
7 2 7 3 7 2 7 6 2 6 4 6 2 6 4 6 2 6 4 6 2 6 4 6 2 6 3 2 3 5 3 2 3 5 3 2 3 5 3 2 3 4 2 4 7 4 2 4 5 2 5 6 5 2 5 1 2 1 7 1 2 1 7 1 2 1 4 2 4 6 4 2 4 7 2 7 1 7 2 7 4 2 4 6 4 2 4 7 2 7 5 7 2 7 4 2 4 6 4 2 4 6 4 2 4 6 4 2 4 6 4 2 4 7 2 7 3 7 2 7 6 2 6 1 6 2 6 7 2 7 5 7 2 7 4 2 4 3 4 2 4 1 2 1 7 1 2 ...

output:

445
1161
5526

result:

ok 3 lines

Test #186:

score: 10
Accepted
time: 2ms
memory: 9840kb

input:

3
2492
5 6 5 6 5 6 5 6 5 2 5 2 5 2 7 2 7 7 2 7 2 7 2 7 2 7 2 7 2 7 2 2 7 6 7 6 7 6 7 6 7 5 7 5 5 7 5 7 5 7 5 7 5 7 3 3 3 7 2 7 2 6 1 6 1 6 1 6 1 6 6 1 1 6 1 6 1 6 1 6 1 2 1 1 2 1 1 2 1 2 1 2 1 2 1 1 1 5 1 5 4 5 4 5 4 1 4 1 4 1 4 1 2 1 2 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 5 2 5 2 5 2 6 2 6 7 6 7 6 6 7...

output:

294
521
359

result:

ok 3 lines

Test #187:

score: 10
Accepted
time: 2ms
memory: 7904kb

input:

3
1415
7 2 7 2 2 7 3 7 3 3 7 3 7 3 7 4 2 4 3 4 2 4 3 4 2 4 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 7 6 2 6 3 2 3 4 3 2 3 4 3 2 3 4 3 2 3 4 3 2 3 4 3 2 3 4 3 2 3 5 2 5 1 5 2 5 1 5 2 5 1 5 2 5 1 5 2 5 1 5 2 5 1 5 2 5...

output:

625
1436
596

result:

ok 3 lines

Test #188:

score: 10
Accepted
time: 28ms
memory: 25504kb

input:

3
17898
1 5 6 1 4 5 1 6 6 1 7 5 5 6 1 7 6 3 5 5 4 7 5 4 1 1 3 7 3 4 3 7 4 7 4 7 5 1 7 1 4 5 2 5 6 1 1 6 5 4 5 6 7 4 6 3 6 4 3 5 1 7 4 2 4 3 6 1 7 4 4 6 6 7 1 4 5 2 7 1 4 6 5 2 4 6 4 3 6 5 2 1 5 3 5 2 7 1 7 1 2 7 4 5 6 3 3 7 1 3 5 1 7 6 5 3 1 3 2 4 4 2 7 7 2 4 7 2 7 1 3 3 4 1 6 3 4 3 1 3 4 4 4 6 4 5 ...

output:

13568
148675
2837

result:

ok 3 lines

Test #189:

score: 10
Accepted
time: 26ms
memory: 16620kb

input:

3
38910
1 6 1 4 1 6 1 4 1 6 1 4 1 6 6 4 6 1 6 4 6 1 4 6 1 6 4 1 6 6 1 4 1 4 6 4 1 4 6 1 4 6 1 4 1 4 6 1 4 6 4 1 6 6 1 4 1 6 4 6 1 6 1 4 1 4 6 6 4 6 1 6 1 4 1 4 1 6 4 1 6 1 4 4 1 4 1 4 6 1 6 1 4 6 1 6 1 4 1 4 1 6 1 4 1 4 6 1 4 1 6 1 6 1 6 4 4 1 6 4 1 4 6 1 1 4 6 4 6 4 1 6 6 1 4 6 6 4 6 4 1 4 1 6 1 1 ...

output:

16989
42639
32426

result:

ok 3 lines

Test #190:

score: 10
Accepted
time: 28ms
memory: 19348kb

input:

3
47211
7 2 7 2 7 2 7 2 7 2 7 2 7 2 7 2 7 2 7 2 7 2 7 2 7 2 7 2 7 2 7 2 7 3 7 3 7 3 7 5 7 5 7 5 7 5 7 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 4 5 3 5 3 5 3 5 3 5 3 5 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 6 3 5 3 5 3 5 3 ...

output:

3525
1703
8644

result:

ok 3 lines

Test #191:

score: 10
Accepted
time: 26ms
memory: 18384kb

input:

3
92161
4 7 4 3 4 7 4 3 4 7 4 1 7 1 2 1 7 1 2 1 7 1 2 1 7 1 2 1 7 1 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 6 4 6 3 ...

output:

68687
56160
24330

result:

ok 3 lines

Test #192:

score: 10
Accepted
time: 30ms
memory: 17088kb

input:

3
81167
1 6 6 1 3 1 3 1 1 3 1 3 1 3 1 3 1 5 5 1 5 3 5 3 5 3 5 3 5 3 5 5 3 5 5 3 3 3 5 3 5 3 5 3 5 5 3 5 5 3 5 3 5 3 5 3 4 4 3 4 3 4 3 4 3 4 3 4 3 4 3 1 1 3 1 1 1 3 1 3 1 3 1 3 3 1 1 3 1 3 1 1 3 1 3 1 3 1 3 1 3 1 5 5 6 5 6 5 6 1 6 1 6 1 6 1 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 6 1 7 1 7 7 1 7 2 7 2 5 5 ...

output:

9129
1840
11031

result:

ok 3 lines

Test #193:

score: 10
Accepted
time: 25ms
memory: 17420kb

input:

3
7124
3 6 5 6 5 2 5 5 2 5 2 5 2 5 5 2 5 2 5 2 5 4 2 2 6 2 3 2 3 2 3 2 3 2 3 3 2 2 2 3 2 3 2 2 3 2 6 2 2 6 6 2 6 3 6 6 3 6 3 6 3 6 3 6 2 2 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 6 2 6 2 6 2 6 2 6 2 3 2 3 2 4 2 4 2 4 2 4 2 4 2 4 5 4 5 4 5 4 5 4 5 4 3 4 4 3 4 4 3 4 3 6 6 3 3 6 3 3 6 3 6 3 3 6 3 4 3 4 3 4 3 7 7...

output:

3675
19486
16811

result:

ok 3 lines

Subtask #6:

score: 20
Accepted

Dependency #3:

100%
Accepted

Test #194:

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

input:

3
2446
75658187 571962292 710943961 75658187 571962292 710943961 75658187 571962292 710943961 75658187 571962292 710943961 75658187 571962292 710943961 75658187 75658187 571962292 710943961 75658187 571962292 710943961 75658187 571962292 710943961 75658187 571962292 710943961 75658187 571962292 7109...

output:

1976
2886
3692

result:

ok 3 lines

Test #195:

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

input:

3
3362
868620636 31980970 377172121 868620636 825296563 377172121 868620636 825296563 825296563 377172121 868620636 825296563 377172121 868620636 825296563 825296563 377172121 868620636 825296563 825296563 377172121 868620636 825296563 377172121 868620636 868620636 825296563 377172121 377172121 8686...

output:

2927
713
4211

result:

ok 3 lines

Test #196:

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

input:

3
6100
984136452 630128462 871470770 984136452 630128462 871470770 871470770 984136452 630128462 630128462 871470770 984136452 630128462 871470770 984136452 630128462 871470770 984136452 630128462 871470770 984136452 630128462 871470770 984136452 630128462 871470770 984136452 630128462 871470770 984...

output:

5703
1225
1688

result:

ok 3 lines

Test #197:

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

input:

20
420
839 222 822 839 222 822 839 222 822 822 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 822 839 222 8...

output:

382
315
240
642
198
495
384
26
237
1165
984
455
216
145
19
349
246
851
1
946

result:

ok 20 lines

Test #198:

score: 20
Accepted
time: 3ms
memory: 11828kb

input:

100
288
54841 69122 34721 54841 69122 69122 34721 69122 56469 34721 69122 54841 34721 69122 54841 34721 69122 69122 54841 34721 69122 69122 69122 54841 34721 69122 54841 34721 69122 54841 34721 69122 54841 34721 69122 54841 34721 34721 69122 54841 34721 69122 54841 34721 69122 69122 54841 54841 3472...

output:

248
80
7
14
41
28
151
13
171
53
40
10
22
3
50
192
84
152
42
53
103
12
29
28
42
168
159
129
46
40
63
156
16
172
68
262
18
56
3
20
16
9
13
25
66
8
182
77
139
34
1
371
94
31
226
256
215
126
24
62
44
86
25
60
2
25
32
148
26
64
96
10
43
22
124
38
15
187
13
156
8
25
66
172
48
16
55
29
222
138
1
65
59
151
...

result:

ok 100 lines

Test #199:

score: 20
Accepted
time: 2ms
memory: 9992kb

input:

1
10000
734574461 950431396 739038911 661754887 457371894 648275232 70663160 696933069 629317065 187291071 990115579 349221249 175620434 575351736 233283750 874565547 747479053 861514245 259747128 115875033 993305117 142386663 106257110 474984733 921047496 306160480 160609288 727062411 468831737 616...

output:

9481

result:

ok single line: '9481'

Test #200:

score: 20
Accepted
time: 5ms
memory: 13964kb

input:

1
10000
308123305 394468846 469701093 641104141 1850670 378047216 708814444 917867224 911621248 861551511 861551511 901418427 581988635 495414163 942546251 310731667 862845973 751983507 29912263 29912263 404044073 262938782 173261407 657494172 328131493 497298590 351166217 19254701 741034149 6055525...

output:

8696

result:

ok single line: '8696'

Test #201:

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

input:

1
10000
881672149 988249400 790297867 770196498 986520935 107819199 757031136 843834084 898958134 535811950 535811950 662978171 79597237 375016404 164516574 533403776 996350592 906231065 903342985 548341018 115035235 793409185 172601682 550005877 224645151 926509129 27316218 27316218 466683201 62926...

output:

9437

result:

ok single line: '9437'

Test #202:

score: 20
Accepted
time: 4ms
memory: 8104kb

input:

1
10000
868190838 876341621 308151080 868190838 308151080 868190838 876341621 308151080 876341621 876341621 308151080 868190838 868190838 308151080 876341621 868190838 876341621 308151080 876341621 308151080 868190838 876341621 868190838 876341621 876341621 868190838 876341621 308151080 868190838 30...

output:

4278

result:

ok single line: '4278'

Test #203:

score: 20
Accepted
time: 4ms
memory: 11896kb

input:

1
10000
181486325 296515491 118032064 296515491 118032064 181486325 296515491 118032064 296515491 181486325 296515491 181486325 296515491 181486325 296515491 181486325 118032064 181486325 118032064 296515491 181486325 118032064 181486325 118032064 296515491 181486325 296515491 181486325 296515491 29...

output:

4728

result:

ok single line: '4728'

Test #204:

score: 20
Accepted
time: 4ms
memory: 11912kb

input:

1
10000
870064335 191125924 416845322 870064335 191125924 870064335 416845322 870064335 191125924 870064335 191125924 416845322 191125924 870064335 191125924 870064335 416845322 191125924 416845322 870064335 191125924 870064335 191125924 870064335 416845322 870064335 416845322 870064335 191125924 87...

output:

5178

result:

ok single line: '5178'

Test #205:

score: 20
Accepted
time: 2ms
memory: 8104kb

input:

1
10000
856583024 247814729 247814729 856583024 247814729 856583024 247814729 856583024 247814729 856583024 247814729 856583024 247814729 856583024 247814729 247814729 856583024 247814729 856583024 247814729 856583024 247814729 856583024 247814729 247814729 149922953 247814729 856583024 856583024 14...

output:

845

result:

ok single line: '845'

Test #206:

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

input:

1
10000
430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 546627987 430131868 54...

output:

946

result:

ok single line: '946'

Test #207:

score: 20
Accepted
time: 4ms
memory: 9892kb

input:

1
10000
3680713 285632732 3680713 285632732 285632732 3680713 285632732 3680713 3680713 285632732 3680713 285632732 3680713 285632732 285632732 3680713 285632732 464469375 285632732 3680713 285632732 3680713 285632732 3680713 285632732 3680713 285632732 3680713 285632732 3680713 285632732 3680713 28...

output:

966

result:

ok single line: '966'

Test #208:

score: 20
Accepted
time: 4ms
memory: 7976kb

input:

1
10000
634460236 820409148 634460236 246992947 634460236 820409148 634460236 246992947 634460236 820409148 634460236 233276518 820409148 233276518 568237542 233276518 820409148 233276518 568237542 233276518 820409148 233276518 462342478 820409148 462342478 502984110 462342478 820409148 462342478 50...

output:

6833

result:

ok single line: '6833'

Test #209:

score: 20
Accepted
time: 4ms
memory: 7924kb

input:

1
10000
495302608 544963117 495302608 164529434 495302608 544963117 495302608 164529434 495302608 544963117 495302608 164529434 495302608 544963117 495302608 164529434 495302608 544963117 495302608 164529434 495302608 544963117 495302608 164529434 495302608 544963117 495302608 164529434 495302608 54...

output:

7478

result:

ok single line: '7478'

Test #210:

score: 20
Accepted
time: 4ms
memory: 11868kb

input:

1
10000
952743147 632326738 952743147 648718805 952743147 632326738 952743147 922040801 632326738 922040801 600631175 922040801 632326738 922040801 600631175 922040801 632326738 922040801 166163427 632326738 166163427 890796892 166163427 632326738 166163427 890796892 166163427 632326738 166163427 68...

output:

6840

result:

ok single line: '6840'

Test #211:

score: 20
Accepted
time: 5ms
memory: 13984kb

input:

1
10000
538400100 399973869 538400100 399973869 399973869 538400100 399973869 538400100 399973869 538400100 399973869 538400100 399973869 538400100 399973869 399973869 538400100 399973869 538400100 399973869 538400100 399973869 538400100 416882229 416882229 538400100 416882229 538400100 247323909 53...

output:

1473

result:

ok single line: '1473'

Test #212:

score: 20
Accepted
time: 4ms
memory: 10100kb

input:

1
10000
406916240 406916240 844011319 406916240 844011319 406916240 844011319 406916240 844011319 406916240 844011319 406916240 406916240 844011319 406916240 844011319 844011319 406916240 844011319 406916240 844011319 406916240 844011319 844011319 844011319 406916240 844011319 844011319 406916240 40...

output:

1349

result:

ok single line: '1349'

Test #213:

score: 20
Accepted
time: 4ms
memory: 11852kb

input:

1
10000
685497788 437791873 685497788 437791873 685497788 437791873 253382153 437791873 253382153 437791873 579183113 579183113 437791873 579183113 579183113 437791873 437791873 579183113 437791873 579183113 437791873 579183113 437791873 579183113 437791873 579183113 437791873 579183113 437791873 57...

output:

1428

result:

ok single line: '1428'

Test #214:

score: 20
Accepted
time: 4ms
memory: 10140kb

input:

1
10000
209997160 820780947 209997160 820780947 209997160 820780947 209997160 820780947 209997160 820780947 209997160 820780947 209997160 820780947 209997160 820780947 209997160 820780947 209997160 820780947 209997160 820780947 209997160 820780947 209997160 820780947 651664175 820780947 209997160 82...

output:

2246

result:

ok single line: '2246'

Test #215:

score: 20
Accepted
time: 4ms
memory: 9920kb

input:

1
10000
909920545 852829954 909920545 413056341 413056341 909920545 413056341 909920545 413056341 413056341 909920545 852829954 413056341 852829954 413056341 852829954 909920545 413056341 909920545 852829954 909920545 852829954 852829954 413056341 852829954 909920545 852829954 909920545 852829954 90...

output:

4494

result:

ok single line: '4494'

Test #216:

score: 20
Accepted
time: 4ms
memory: 11856kb

input:

1
10000
855631609 961043154 855631609 768222369 855631609 961043154 855631609 768222369 855631609 961043154 855631609 101988932 961043154 101988932 970203695 101988932 961043154 101988932 970203695 101988932 961043154 101988932 958200865 961043154 958200865 288788749 958200865 961043154 958200865 28...

output:

4112

result:

ok single line: '4112'

Test #217:

score: 20
Accepted
time: 3ms
memory: 11792kb

input:

5
1099
78 78 70 24 32 96 96 34 96 57 95 9 40 28 78 49 6 32 84 99 20 30 81 59 81 80 50 56 27 32 74 71 70 70 59 92 22 17 35 98 30 95 62 65 22 9 9 40 6 53 9 66 19 5 71 28 21 70 11 3 55 85 89 95 13 94 67 58 94 55 79 32 83 83 10 95 95 64 82 71 45 8 39 55 15 15 3 46 97 66 5 66 39 39 75 47 50 44 10 46 40 4...

output:

1000
3698
1955
38
2510

result:

ok 5 lines

Test #218:

score: 20
Accepted
time: 3ms
memory: 11836kb

input:

5
2542
54 97 54 97 47 97 47 54 97 47 54 97 54 54 47 97 47 54 47 54 97 47 97 47 54 97 54 54 97 54 97 47 97 54 47 97 54 97 54 97 54 97 54 97 54 97 54 97 54 97 54 97 47 54 54 97 54 97 47 54 97 54 97 54 97 47 97 47 97 47 54 97 54 47 97 54 97 54 54 97 97 47 97 54 47 54 47 97 54 97 47 54 97 97 47 47 97 54...

output:

1214
2320
618
197
387

result:

ok 5 lines

Test #219:

score: 20
Accepted
time: 2ms
memory: 7760kb

input:

5
80
20 41 20 41 20 41 20 41 20 41 20 10 20 42 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 10 20 20 10 20 20 10 20 84 20 10 84 20 84 84 20 84 20 84 20 84 20 84 20 84 20 8 20 84 20 84 20 20
2887
96 11 64 11 96 64 96 64 96 64 96 64 96 64 96 64 96 ...

output:

14
237
283
96
221

result:

ok 5 lines

Test #220:

score: 20
Accepted
time: 2ms
memory: 11836kb

input:

5
5164
27 89 27 33 27 89 27 33 27 89 27 33 27 89 27 33 27 89 27 33 27 89 27 33 27 89 27 33 27 89 27 33 27 89 27 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70 10 70 89 70...

output:

3796
151
1561
1309
256

result:

ok 5 lines

Test #221:

score: 20
Accepted
time: 2ms
memory: 7796kb

input:

5
960
65 100 65 100 65 100 65 100 65 69 65 69 65 69 65 29 65 29 65 29 65 29 65 29 65 29 65 29 65 29 65 29 9 29 9 29 9 29 9 29 9 29 9 2 9 2 9 51 9 51 9 51 9 51 9 51 9 51 9 51 9 51 9 51 9 51 47 51 51 47 51 47 51 47 22 47 22 47 22 47 22 47 19 47 19 47 19 47 19 47 82 82 47 82 47 82 47 4 4 47 4 47 4 91 9...

output:

151
163
603
272
281

result:

ok 5 lines

Test #222:

score: 20
Accepted
time: 3ms
memory: 11780kb

input:

5
3302
64 25 64 25 25 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 64 25 64 25 64 25 25 64 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 25 64 64 64 25 64 25 27 25 44 27 44 25 44 27 25 27 25 27 25 25 27 25 27 25 25 27 25 27 25 17 25 17 25 17 25 17 25 17...

output:

253
1262
2
288
49

result:

ok 5 lines

Test #223:

score: 20
Accepted
time: 2ms
memory: 11912kb

input:

3
8744
271892247 837581997 607524695 794809165 884473726 691733000 110148098 658687030 902054061 423465795 190088609 566529866 309760669 327902716 804167805 988187078 867548935 352539955 473257188 645497998 442040811 193896907 574361509 783368870 334928397 203931404 354254999 49611706 127279475 7089...

output:

8572
163
991

result:

ok 3 lines

Test #224:

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

input:

3
3235
297227664 66298589 2554429 66298589 2554429 297227664 2554429 297227664 66298589 2554429 297227664 2554429 66298589 66298589 297227664 66298589 297227664 66298589 297227664 2554429 66298589 297227664 2554429 297227664 66298589 297227664 2554429 297227664 2554429 66298589 297227664 2554429 662...

output:

1603
144
2853

result:

ok 3 lines

Test #225:

score: 20
Accepted
time: 4ms
memory: 7860kb

input:

3
891
28183907 796280504 28183907 796280504 28183907 796280504 28183907 796280504 28183907 28183907 796280504 28183907 796280504 28183907 796280504 28183907 796280504 28183907 796280504 28183907 796280504 28183907 796280504 28183907 796280504 28183907 796280504 28183907 796280504 28183907 796280504 ...

output:

72
381
480

result:

ok 3 lines

Test #226:

score: 20
Accepted
time: 4ms
memory: 11920kb

input:

3
7196
402150913 127955569 402150913 841077227 402150913 127955569 402150913 564451461 127955569 564451461 272692136 564451461 127955569 564451461 266101277 127955569 266101277 340442723 266101277 127955569 266101277 357668733 127955569 357668733 41179751 357668733 127955569 357668733 132438946 1279...

output:

4715
943
955

result:

ok 3 lines

Test #227:

score: 20
Accepted
time: 4ms
memory: 9928kb

input:

3
9024
784475566 904722115 904722115 784475566 904722115 784475566 904722115 784475566 784475566 904722115 784475566 904722115 784475566 904722115 784475566 904722115 784475566 904722115 784475566 904722115 784475566 904722115 784475566 904722115 784475566 904722115 784475566 904722115 784475566 714...

output:

1233
110
17

result:

ok 3 lines

Test #228:

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

input:

3
852
735021932 859595884 735021932 377307463 735021932 859595884 735021932 377307463 735021932 859595884 735021932 377307463 735021932 859595884 735021932 377307463 735021932 859595884 735021932 377307463 735021932 859595884 735021932 377307463 735021932 859595884 735021932 377307463 735021932 8595...

output:

636
4134
1454

result:

ok 3 lines

Test #229:

score: 20
Accepted
time: 4ms
memory: 11904kb

input:

10
985
556318599 337558189 776606794 463992185 819447735 726997306 773524252 466489823 308046874 179638870 777091156 768589666 892786787 888619441 472311820 715549485 219808693 261065617 152205075 928412736 107638568 442628433 215985004 222248942 510561866 94453214 147491533 666716767 977078683 1025...

output:

952
838
1296
810
288
955
409
699
451
2702

result:

ok 10 lines

Test #230:

score: 20
Accepted
time: 4ms
memory: 7812kb

input:

10
1052
230579038 230579038 804150637 494625677 804150637 589225078 230579038 589225078 589225078 230579038 230579038 589225078 230579038 230579038 494625677 230579038 494625677 589225078 230579038 230579038 230579038 494625677 589225078 230579038 494625677 230579038 494625677 494625677 494625677 49...

output:

476
355
540
56
1176
413
165
788
374
405

result:

ok 10 lines

Test #231:

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

input:

10
766
904839478 715453484 904839478 715453484 904839478 715453484 904839478 715453484 904839478 715453484 904839478 715453484 904839478 715453484 904839478 715453484 904839478 715453484 715453484 904839478 715453484 904839478 715453484 904839478 715453484 904839478 715453484 904839478 904839478 715...

output:

70
6
59
167
41
59
238
121
58
79

result:

ok 10 lines

Test #232:

score: 20
Accepted
time: 4ms
memory: 11756kb

input:

10
41
473524316 219680882 473524316 663497825 473524316 219680882 473524316 663497825 473524316 219680882 473524316 663497825 473524316 219680882 473524316 363506594 219680882 363506594 483808807 363506594 219680882 363506594 289401374 219680882 289401374 244286095 289401374 219680882 289401374 3590...

output:

29
875
1218
132
154
500
740
1445
937
1082

result:

ok 10 lines

Test #233:

score: 20
Accepted
time: 4ms
memory: 11828kb

input:

10
223
958393061 533540268 958393061 533540268 958393061 533540268 958393061 533540268 958393061 533540268 958393061 533540268 958393061 533540268 958393061 533540268 958393061 533540268 958393061 533540268 958393061 563097273 958393061 563097273 958393061 563097273 958393061 213372339 958393061 213...

output:

36
115
158
170
111
62
173
122
198
388

result:

ok 10 lines

Test #234:

score: 20
Accepted
time: 4ms
memory: 9816kb

input:

10
649
410359269 200609801 410359269 362666795 410359269 200609801 410359269 362666795 410359269 200609801 410359269 323100141 200609801 323100141 733150141 323100141 200609801 323100141 733150141 323100141 200609801 323100141 186717550 200609801 186717550 785279798 186717550 200609801 186717550 785...

output:

474
175
21
116
326
28
2648
343
735
153

result:

ok 10 lines

Test #235:

score: 20
Accepted
time: 5ms
memory: 11880kb

input:

100
51
430248149 595547947 427939051 835633536 514974798 990648367 803482887 28240806 902073411 275015766 134113439 580898966 308365477 823365832 190643605 190643605 580707257 426771559 344069453 745545488 968683867 546222596 821328086 285468156 965270828 406853112 925794802 872426375 773112000 3971...

output:

50
13
66
4
111
100
119
27
159
110
110
22
135
172
42
56
102
2
51
153
28
126
4
4
2
40
88
52
36
63
62
26
168
13
66
67
69
108
313
200
33
28
23
117
66
1
28
185
58
47
9
137
2
219
101
23
29
89
47
170
68
30
350
280
171
32
137
73
16
70
17
153
16
16
29
30
142
72
68
64
62
31
98
77
320
24
93
140
289
186
73
103
...

result:

ok 100 lines

Test #236:

score: 20
Accepted
time: 4ms
memory: 7672kb

input:

100
69
131484946 970094423 131484946 970094423 131484946 970094423 83886046 970094423 131484946 970094423 83886046 970094423 131484946 83886046 131484946 83886046 131484946 970094423 131484946 83886046 131484946 83886046 970094423 131484946 83886046 970094423 131484946 83886046 131484946 83886046 13...

output:

29
111
52
91
42
5
101
9
131
27
4
19
15
3
7
27
25
58
16
14
4
113
11
39
8
41
1
2
21
95
10
16
124
13
28
52
31
64
37
19
67
15
4
52
82
104
2
137
6
19
3
94
74
45
224
40
117
58
24
19
114
10
244
77
98
8
263
47
9
180
5
65
138
34
50
17
42
104
31
64
10
76
45
27
65
53
27
248
17
2
55
30
4
7
15
46
28
18
10
10

result:

ok 100 lines

Test #237:

score: 20
Accepted
time: 4ms
memory: 7680kb

input:

100
4
159016731 655164889 159016731 655164889
84
33319647 740077354 33319647 740077354 33319647 740077354 740077354 33319647 740077354 33319647 740077354 33319647 33319647 740077354 33319647 740077354 33319647 740077354 33319647 740077354 33319647 740077354 33319647 740077354 33319647 33319647 74007...

output:

2
7
26
4
24
2
10
11
2
2
2
2
22
47
11
8
14
17
2
2
8
21
34
7
13
10
16
5
11
2
6
13
11
7
5
4
4
4
9
2
20
20
13
4
2
15
2
2
19
2
2
14
2
2
14
2
4
2
34
7
28
16
9
9
14
21
2
31
2
9
40
12
2
4
8
7
2
7
6
2
4
17
19
2
12
7
2
21
23
2
40
5
4
2
2
9
18
55
2
7

result:

ok 100 lines

Test #238:

score: 20
Accepted
time: 4ms
memory: 11816kb

input:

100
4
889287704 195011163 441162642 978768224
57
659079325 851369709 659079325 321424541 659079325 851369709 659079325 321424541 659079325 851369709 659079325 407730449 851369709 407730449 106964916 407730449 851369709 407730449 911294398 851369709 911294398 893080717 911294398 851369709 911294398 8...

output:

4
41
138
158
13
22
25
246
8
89
14
123
258
18
16
116
82
52
164
12
129
38
48
152
16
59
119
17
18
225
154
14
14
54
230
296
101
120
96
142
10
46
16
1
36
4
40
76
27
15
38
306
208
96
37
34
123
17
11
7
56
27
5
1
23
16
18
17
81
79
59
116
19
18
42
17
84
19
88
107
9
53
68
83
4
39
34
120
154
101
10
33
16
4
41
...

result:

ok 100 lines

Test #239:

score: 20
Accepted
time: 4ms
memory: 7684kb

input:

100
52
474334485 734857437 474334485 734857437 474334485 734857437 474334485 38398488 809983092 38398488 809983092 201497944 809983092 201497944 809983092 201497944 809983092 201497944 809983092 137916787 809983092 137916787 809983092 137916787 809983092 137916787 809983092 137916787 809983092 45871...

output:

10
53
6
8
10
14
10
50
11
5
25
7
6
5
8
22
2
22
10
7
17
28
4
12
17
51
11
11
11
16
10
3
11
30
17
28
14
4
2
2
21
30
5
23
27
20
27
18
7
28
4
15
12
4
2
80
25
23
11
55
10
37
45
2
5
3
3
5
16
14
16
42
43
18
25
2
25
14
6
21
6
18
28
20
4
4
6
21
1
21
15
6
2
5
4
5
43
2
2
49

result:

ok 100 lines

Test #240:

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

input:

100
40
505908428 618853372 505908428 181600193 505908428 277393924 47744413 382811698 47744413 382811698 382811698 47744413 382811698 47744413 382811698 47744413 382811698 47744413 382811698 47744413 382811698 47744413 382811698 193746294 257308980 193746294 257308980 193746294 257308980 193746294 2...

output:

12
3
22
53
40
65
19
59
21
42
44
8
32
13
25
56
18
30
19
15
37
41
15
27
50
98
22
52
4
28
16
136
33
5
137
36
7
46
18
76
47
198
22
29
49
6
82
6
89
37
35
23
4
22
87
36
7
38
15
52
42
43
25
49
66
25
51
36
58
64
31
28
17
40
99
58
16
38
122
54
99
30
90
44
15
8
12
64
103
128
60
65
23
62
6
110
16
49
18
18

result:

ok 100 lines

Test #241:

score: 20
Accepted
time: 5ms
memory: 9780kb

input:

1000
13
65469610 991719914 20100560 489070913 475381560 213845477 213845477 457600236 266497674 654005412 626941459 398562720 992704911
3
650880838 126367074 557698553
16
550741810 727995746 86825539 378942732 344477715 710837758 710837758 69212469 873261114 798025897 472932830 472932830 193023381 3...

output:

12
3
14
22
2
18
48
2
58
27
27
3
18
1
53
2
1
11
4
3
9
5
1
22
15
1
14
5
3
5
11
6
4
2
3
11
7
17
1
5
2
1
93
2
26
11
10
3
17
3
7
10
18
13
24
9
13
16
2
3
13
6
4
1
8
12
28
14
22
1
26
39
9
41
6
3
2
9
18
13
4
1
5
5
3
7
21
6
2
12
5
23
6
4
5
1
2
2
6
8
2
12
4
31
10
12
1
7
8
1
10
17
1
2
11
14
19
1
9
3
19
31
1
2
...

result:

ok 1000 lines

Test #242:

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

input:

1000
12
659817449 785903637 659817449 517000663 517000663 659817449 517000663 517000663 527199593 659817449 527199593 1664346
3
918547615 461200104 513332410
18
120221431 840760226 733945446 840760226 120221431 840760226 120221431 219199783 733945446 219199783 320934632 219199783 733945446 320934632...

output:

6
3
12
8
8
4
5
2
2
3
5
2
5
3
10
4
4
3
3
18
7
5
6
1
10
3
3
4
5
4
12
7
9
4
5
5
4
11
9
4
3
4
6
4
3
17
11
5
4
7
1
25
5
3
2
15
4
6
8
5
2
8
1
6
4
1
4
2
1
21
4
2
18
2
2
1
2
1
8
2
11
4
5
10
7
17
7
5
3
7
6
4
13
4
4
3
15
8
2
18
1
7
3
4
2
3
2
3
4
2
4
12
16
2
8
10
3
3
3
15
3
3
6
6
18
15
7
2
1
6
1
1
1
9
3
19
14
...

result:

ok 1000 lines

Test #243:

score: 20
Accepted
time: 2ms
memory: 11876kb

input:

1000
17
319871654 661497248 319871654 661497248 661497248 319871654 661497248 319871654 661497248 319871654 661497248 319871654 661497248 319871654 661497248 319871654 319871654
6
39553228 772818118 39553228 772818118 39553228 772818118
11
679053694 199400509 679053694 199400509 679053694 199400509 ...

output:

2
2
4
2
1
3
2
2
17
2
7
1
2
5
5
2
2
2
2
2
2
2
2
2
2
2
2
2
7
2
2
2
2
2
28
2
2
2
2
2
3
8
2
2
2
2
2
4
1
8
2
2
4
2
2
4
3
2
8
8
2
2
2
2
2
2
6
2
2
2
2
1
2
4
2
7
2
4
2
2
13
2
2
2
2
2
5
2
2
2
2
1
2
2
1
2
2
1
2
2
2
2
2
11
2
2
2
2
2
4
1
2
2
2
9
2
2
1
1
1
2
2
9
2
2
2
2
2
1
6
2
2
2
2
2
2
2
2
2
1
2
2
2
1
2
2
1
2
...

result:

ok 1000 lines

Test #244:

score: 20
Accepted
time: 2ms
memory: 9852kb

input:

1000
6
825417413 85751262 454730666 453585864 453585864 759698941
1
811367169
5
641525940 387598365 151894879 318044796 292982108
1
801662106
3
76134215 454159923 98731974
3
721571808 680208193 343700905
14
792683771 753232717 737533679 777512741 312417896 590946850 600473838 628626452 492843094 492...

output:

5
1
5
1
3
3
13
6
5
17
1
24
9
2
4
2
18
12
5
34
15
1
7
7
17
1
2
4
4
10
1
4
20
4
4
2
17
15
8
12
15
2
9
1
11
14
7
11
7
12
10
8
3
2
12
14
2
6
4
3
2
19
9
1
25
6
2
1
3
4
9
2
6
2
22
4
3
14
10
17
12
1
18
1
14
9
1
2
14
9
2
20
12
7
13
25
5
5
3
3
4
22
7
6
2
6
36
13
4
9
5
23
4
16
14
12
17
8
7
9
3
1
11
4
5
16
18
...

result:

ok 1000 lines

Test #245:

score: 20
Accepted
time: 2ms
memory: 7740kb

input:

1000
13
206471670 388451323 206471670 388451323 206471670 388451323 206471670 388451323 206471670 206471670 519740349 206471670 519740349
3
418074007 660597910 418074007
3
625120517 31247350 625120517
17
893102736 26378378 893102736 26378378 893102736 26378378 26378378 893102736 495201789 893102736 ...

output:

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

result:

ok 1000 lines

Test #246:

score: 20
Accepted
time: 5ms
memory: 7816kb

input:

1000
3
766541662 471465812 448211194
5
531888050 984075764 531888050 119961231 129815296
1
146934898
3
302741290 229903321 20508998
5
328635635 853953429 125675059 694949287 523746471
10
164301402 231633085 940358361 433142011 940358361 819286852 914599867 819286852 914599867 819286852
9
733957740 6...

output:

3
4
1
3
5
6
8
6
4
12
20
4
2
11
2
4
7
10
19
14
2
2
3
10
15
14
6
1
2
2
3
17
7
12
11
2
2
3
38
2
13
2
1
6
1
2
9
1
12
8
4
5
3
7
11
13
2
3
10
8
20
4
15
5
27
10
7
4
21
15
9
5
5
20
9
3
3
3
1
1
2
1
3
3
9
4
7
3
3
19
2
7
8
11
2
8
9
2
17
3
8
13
4
6
2
13
8
20
3
1
5
14
2
11
2
11
10
8
4
18
9
10
5
1
12
14
13
4
5
4
...

result:

ok 1000 lines

Subtask #7:

score: 43
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Dependency #5:

100%
Accepted

Dependency #6:

100%
Accepted

Test #247:

score: 43
Accepted
time: 58ms
memory: 25668kb

input:

1
200000
173178881 896023891 712273461 68498679 68498679 15447248 8435646 848550287 26680689 544183211 180321663 180321663 109831482 731352831 731352831 895812821 547339509 603866489 353397459 470812338 755517763 638961397 772711715 772711715 199913037 919361745 20292922 33801639 868274645 868274645...

output:

167727

result:

ok single line: '167727'

Test #248:

score: 43
Accepted
time: 57ms
memory: 24740kb

input:

1
200000
746727725 340061341 588159835 47847933 559926025 738207629 486701571 952647548 531520098 559614806 166358522 374185625 920639254 619566728 826538599 781869374 920027192 923915781 78225638 919775464 115028111 729436550 682358793 56115496 738584854 544629782 647211989 646562342 890315130 7094...

output:

184041

result:

ok single line: '184041'

Test #249:

score: 43
Accepted
time: 59ms
memory: 23900kb

input:

1
200000
25309273 638874598 638874598 613789312 881972995 544596290 613203804 534918263 878614408 813824280 233875246 782694073 311985715 240432983 136504347 136504347 903986516 770149800 924531646 797346503 797346503 517489879 66839212 440208593 244544059 244544059 904233177 783462057 463670870 463...

output:

167021

result:

ok single line: '167021'

Test #250:

score: 43
Accepted
time: 61ms
memory: 24784kb

input:

1
200000
866603770 404914512 324619813 324619813 404914512 866603770 324619813 404914512 866603770 324619813 866603770 324619813 866603770 324619813 404914512 324619813 404914512 324619813 866603770 324619813 404914512 324619813 404914512 866603770 404914512 324619813 404914512 866603770 324619813 4...

output:

87129

result:

ok single line: '87129'

Test #251:

score: 43
Accepted
time: 55ms
memory: 23900kb

input:

1
200000
142030468 440152615 452239299 142030468 440152615 440152615 452239299 142030468 440152615 452239299 142030468 452239299 440152615 142030468 452239299 440152615 452239299 440152615 452239299 440152615 452239299 142030468 452239299 142030468 440152615 452239299 440152615 142030468 440152615 1...

output:

95280

result:

ok single line: '95280'

Test #252:

score: 43
Accepted
time: 60ms
memory: 26604kb

input:

1
200000
67549251 182901481 67549251 182901481 67549251 182901481 67549251 182901481 67549251 182901481 13701459 67549251 182901481 13701459 67549251 182901481 67549251 182901481 182901481 67549251 13701459 182901481 67549251 67549251 13701459 182901481 13701459 67549251 182901481 13701459 182901481...

output:

87049

result:

ok single line: '87049'

Test #253:

score: 43
Accepted
time: 57ms
memory: 24772kb

input:

1
200000
854995956 898439927 854995956 898439927 854995956 898439927 854995956 898439927 854995956 854995956 898439927 854995956 898439927 898439927 854995956 898439927 854995956 898439927 854995956 898439927 854995956 898439927 898439927 854995956 898439927 854995956 898439927 854995956 898439927 8...

output:

16396

result:

ok single line: '16396'

Test #254:

score: 43
Accepted
time: 58ms
memory: 24796kb

input:

1
200000
428544800 428544800 492220481 428544800 492220481 428544800 428544800 428544800 492220481 428544800 492220481 428544800 492220481 428544800 492220481 492220481 428544800 492220481 428544800 492220481 428544800 492220481 428544800 492220481 428544800 492220481 428544800 428544800 492220481 4...

output:

16806

result:

ok single line: '16806'

Test #255:

score: 43
Accepted
time: 57ms
memory: 24320kb

input:

1
200000
297060941 231225227 771104372 231225227 231225227 297060941 231225227 771104372 231225227 806370363 231225227 806370363 231225227 806370363 231225227 231225227 806370363 231225227 806370363 231225227 806370363 231225227 806370363 231225227 806370363 231225227 806370363 231225227 806370363 2...

output:

18125

result:

ok single line: '18125'

Test #256:

score: 43
Accepted
time: 57ms
memory: 24832kb

input:

1
200000
90158840 924900422 90158840 40161504 90158840 924900422 90158840 40161504 90158840 924900422 90158840 40161504 90158840 924900422 90158840 40161504 90158840 924900422 90158840 40161504 90158840 924900422 90158840 40161504 90158840 924900422 90158840 40161504 90158840 924900422 90158840 4016...

output:

149466

result:

ok single line: '149466'

Test #257:

score: 43
Accepted
time: 56ms
memory: 24240kb

input:

1
200000
143463518 707724383 143463518 710715679 143463518 707724383 143463518 892806296 707724383 892806296 998821896 892806296 707724383 892806296 998821896 892806296 707724383 892806296 998821896 892806296 707724383 892806296 998821896 892806296 707724383 892806296 998821896 892806296 707724383 8...

output:

149433

result:

ok single line: '149433'

Test #258:

score: 43
Accepted
time: 51ms
memory: 26552kb

input:

1
200000
249332409 672703661 249332409 872208233 249332409 672703661 249332409 872208233 249332409 672703661 249332409 872208233 249332409 672703661 249332409 872208233 249332409 672703661 249332409 872208233 249332409 672703661 249332409 872208233 249332409 672703661 249332409 872208233 249332409 6...

output:

149778

result:

ok single line: '149778'

Test #259:

score: 43
Accepted
time: 60ms
memory: 24744kb

input:

1
200000
682037224 345566364 682037224 345566364 682037224 682037224 345566364 286485654 345566364 286485654 345566364 286485654 345566364 486471328 345566364 486471328 345566364 486471328 345566364 486471328 345566364 363898245 345566364 363898245 345566364 363898245 345566364 363898245 451272194 3...

output:

29369

result:

ok single line: '29369'

Test #260:

score: 43
Accepted
time: 57ms
memory: 26672kb

input:

1
200000
550553364 84571110 550553364 84571110 550553364 84571110 550553364 84571110 63266242 84571110 63266242 84571110 63266242 84571110 63266242 84571110 63266242 84571110 63266242 84571110 63266242 84571110 63266242 84571110 63266242 84571110 63266242 84571110 63266242 150357589 63266242 8541634...

output:

29093

result:

ok single line: '29093'

Test #261:

score: 43
Accepted
time: 56ms
memory: 26676kb

input:

1
200000
978878016 383384367 978878016 383384367 978878016 383384367 978878016 383384367 978878016 383384367 383384367 978878016 383384367 978878016 383384367 978878016 383384367 978878016 383384367 978878016 383384367 978878016 383384367 978878016 790201085 978878016 790201085 978878016 790201085 8...

output:

28968

result:

ok single line: '28968'

Test #262:

score: 43
Accepted
time: 50ms
memory: 25836kb

input:

1
200000
147418342 540973334 540973334 147418342 540973334 540973334 147418342 540973334 147418342 540973334 147418342 540973334 147418342 147418342 540973334 540973334 147418342 540973334 147418342 540973334 147418342 540973334 147418342 490769369 540973334 540973334 490769369 540973334 540973334 4...

output:

97832

result:

ok single line: '97832'

Test #263:

score: 43
Accepted
time: 53ms
memory: 25764kb

input:

1
200000
975746312 833379068 975746312 993059195 975746312 833379068 975746312 993059195 975746312 833379068 975746312 993059195 975746312 833379068 975746312 993059195 975746312 833379068 975746312 993059195 975746312 833379068 975746312 993059195 975746312 833379068 975746312 993059195 975746312 8...

output:

86207

result:

ok single line: '86207'

Test #264:

score: 43
Accepted
time: 63ms
memory: 25904kb

input:

1
200000
722357685 594833087 722357685 594833087 722357685 594833087 722357685 594833087 722357685 594833087 722357685 594833087 722357685 594833087 722357685 594833087 722357685 594833087 722357685 832003603 722357685 594833087 722357685 722357685 832003603 722357685 594833087 722357685 594833087 7...

output:

69483

result:

ok single line: '69483'

Test #265:

score: 43
Accepted
time: 33ms
memory: 21104kb

input:

5
140744
78 81 99 79 54 83 47 88 97 61 60 43 19 82 2 97 68 84 19 43 91 14 48 35 32 19 89 83 91 72 32 81 54 81 2 22 63 97 18 94 88 70 79 58 50 86 30 34 22 96 3 100 3 88 79 83 50 7 84 72 44 52 53 52 11 85 74 80 62 86 49 60 40 61 24 29 17 5 25 67 2 16 51 31 44 41 80 90 77 10 1 97 14 94 56 43 74 65 87 9...

output:

138962
15890
33590
492
5156

result:

ok 5 lines

Test #266:

score: 43
Accepted
time: 32ms
memory: 19580kb

input:

5
380
100 47 93 100 56 93 100 93 56 56 93 56 100 56 93 56 100 93 100 93 93 100 56 100 100 93 100 100 56 100 56 100 56 93 93 56 100 93 56 100 93 56 93 18 93 93 93 93 93 56 93 56 18 93 18 56 93 18 93 56 93 18 56 93 18 56 93 93 56 56 93 56 93 56 93 18 93 56 93 18 18 93 93 93 56 18 93 18 56 93 56 93 18 ...

output:

177
3710
3008
22515
60332

result:

ok 5 lines

Test #267:

score: 43
Accepted
time: 31ms
memory: 15312kb

input:

5
47488
20 39 20 39 20 39 20 39 20 39 20 39 20 39 20 39 20 39 20 39 20 39 45 39 76 44 76 44 76 44 76 10 44 10 44 44 10 44 10 44 10 44 10 44 10 44 10 44 10 44 10 44 10 66 66 10 66 10 66 10 66 10 66 10 10 18 10 18 10 18 10 18 10 18 10 18 10 18 10 18 10 18 10 18 10 18 10 18 10 18 10 18 10 18 10 18 10 4...

output:

4111
1087
1881
8659
1644

result:

ok 5 lines

Test #268:

score: 43
Accepted
time: 26ms
memory: 18244kb

input:

5
79728
30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 20 30 53 30 2...

output:

59488
7716
15640
65094
529

result:

ok 5 lines

Test #269:

score: 43
Accepted
time: 28ms
memory: 18260kb

input:

5
31856
66 98 66 98 66 98 66 98 66 98 66 98 66 98 66 66 98 98 66 98 66 98 66 98 66 98 66 98 66 98 66 98 66 98 66 98 66 98 66 98 66 22 66 22 66 22 66 22 66 73 66 73 92 73 73 92 73 100 73 87 73 87 73 87 73 87 73 87 73 87 73 87 73 30 73 30 73 30 73 34 73 34 73 34 73 34 73 34 73 34 73 34 73 34 73 81 73 ...

output:

4778
2001
3621
11050
6475

result:

ok 5 lines

Test #270:

score: 43
Accepted
time: 27ms
memory: 17244kb

input:

5
89745
14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 93 14 58 14 9...

output:

24843
12107
5262
504
6335

result:

ok 5 lines

Test #271:

score: 43
Accepted
time: 62ms
memory: 18940kb

input:

3
125599
133378735 832010674 161753652 161753652 645651307 270011355 551373122 152334936 524225333 243628828 819252472 378939350 694575896 680137276 953591907 986828810 191448967 266194251 845923577 883615446 950552 580504347 818387089 17943839 213076740 110579652 195291112 195291112 550027086 29039...

output:

111444
50859
12554

result:

ok 3 lines

Test #272:

score: 43
Accepted
time: 58ms
memory: 19020kb

input:

3
116725
845424627 845424627 811359927 845424627 811359927 1199725 845424627 1199725 811359927 845424627 811359927 845424627 811359927 1199725 811359927 845424627 1199725 1199725 1199725 1199725 845424627 845424627 811359927 845424627 1199725 845424627 811359927 1199725 845424627 811359927 845424627...

output:

50119
20744
17923

result:

ok 3 lines

Test #273:

score: 43
Accepted
time: 57ms
memory: 21472kb

input:

3
25467
34894586 645484989 34894586 34894586 34894586 34894586 645484989 34894586 283740734 283740734 645484989 283740734 645484989 273080211 645484989 273080211 273080211 273080211 273080211 273080211 645484989 273080211 645484989 273080211 645484989 273080211 645484989 273080211 645484989 27308021...

output:

1822
12504
1975

result:

ok 3 lines

Test #274:

score: 43
Accepted
time: 60ms
memory: 20496kb

input:

3
11092
467165437 281856111 467165437 895882616 467165437 281856111 467165437 895882616 467165437 281856111 467165437 398319181 920436933 398319181 792124063 398319181 920436933 398319181 402542391 920436933 402542391 372026786 402542391 920436933 402542391 372026786 402542391 920436933 402542391 37...

output:

7896
109098
32132

result:

ok 3 lines

Test #275:

score: 43
Accepted
time: 51ms
memory: 18336kb

input:

3
32104
791186246 309216200 791186246 309216200 791186246 309216200 791186246 309216200 309216200 791186246 309216200 167872868 309216200 167872868 275106448 167872868 275106448 167872868 275106448 167872868 275106448 167872868 275106448 167872868 275106448 167872868 275106448 275106448 167872868 28...

output:

4647
8456
17254

result:

ok 3 lines

Test #276:

score: 43
Accepted
time: 53ms
memory: 24528kb

input:

3
7837
287165182 576723408 287165182 693905951 287165182 576723408 287165182 693905951 287165182 576723408 287165182 693905951 287165182 576723408 287165182 693905951 287165182 576723408 287165182 693905951 287165182 576723408 287165182 693905951 287165182 576723408 287165182 693905951 287165182 576...

output:

4884
1779
63883

result:

ok 3 lines

Test #277:

score: 43
Accepted
time: 57ms
memory: 12660kb

input:

10
10441
42395080 475856297 422265570 404184634 458060689 849640427 263923434 559130792 902883925 500842242 907988864 796449601 779762070 842764735 737319344 239895155 239895155 189252235 462840780 545392507 69371072 204302496 204302496 579574307 44238934 393075516 170761713 319351188 675749290 4734...

output:

8761
47200
745
5175
42101
33667
14972
11487
17375
4852

result:

ok 10 lines

Test #278:

score: 43
Accepted
time: 57ms
memory: 14300kb

input:

10
27074
286596526 11622816 237416041 286596526 11622816 286596526 237416041 286596526 237416041 11622816 286596526 237416041 286596526 11622816 286596526 237416041 11622816 237416041 11622816 237416041 286596526 237416041 286596526 11622816 237416041 11622816 286596526 11622816 286596526 286596526 ...

output:

13443
3263
3930
859
6768
10092
20883
11813
2644
22496

result:

ok 10 lines

Test #279:

score: 43
Accepted
time: 56ms
memory: 12672kb

input:

10
22502
390915960 998975784 390915960 998975784 390915960 998975784 390915960 390915960 998975784 390915960 998975784 390915960 998975784 390915960 998975784 390915960 998975784 390915960 998975784 390915960 998975784 390915960 998975784 390915960 998975784 390915960 998975784 998975784 390915960 9...

output:

2155
191
2094
122
202
456
3687
2995
1083
3196

result:

ok 10 lines

Test #280:

score: 43
Accepted
time: 55ms
memory: 12452kb

input:

10
31802
489992038 763277219 489992038 682378405 489992038 763277219 489992038 682378405 489992038 763277219 489992038 682378405 489992038 763277219 489992038 682378405 489992038 763277219 489992038 682378405 489992038 763277219 489992038 682378405 489992038 763277219 489992038 682378405 489992038 7...

output:

23306
12889
4361
19851
6335
1061
6884
28560
13407
30290

result:

ok 10 lines

Test #281:

score: 43
Accepted
time: 60ms
memory: 14948kb

input:

10
1773
739436839 817062568 739436839 817062568 739436839 817062568 739436839 817062568 739436839 817062568 739436839 817062568 739436839 817062568 739436839 817062568 817062568 739436839 817062568 739436839 817062568 739436839 739436839 686318499 739436839 686318499 739436839 686318499 739436839 68...

output:

274
4263
1682
1083
5633
2324
194
7130
1671
3376

result:

ok 10 lines

Test #282:

score: 43
Accepted
time: 55ms
memory: 14048kb

input:

10
13361
140797244 200302029 140797244 281043221 140797244 200302029 140797244 281043221 140797244 200302029 140797244 281043221 140797244 200302029 140797244 281043221 140797244 200302029 140797244 281043221 140797244 200302029 140797244 766419863 200302029 766419863 738799435 766419863 200302029 7...

output:

6836
9985
2225
1618
1829
8440
10310
5185
34038
9143

result:

ok 10 lines

Test #283:

score: 43
Accepted
time: 60ms
memory: 8064kb

input:

100
1734
278644788 601308129 601308129 285517455 495679005 30140897 685423831 152213160 832913511 16045099 300017400 427095704 503381319 526379884 372732330 266480151 253183828 855029982 229666775 113568259 389102825 977718564 620259434 497850080 462186661 780082880 199254742 229114195 743908331 761...

output:

1634
876
621
56
795
5985
82
1036
3759
262
587
2164
560
3643
1422
2063
198
5166
1988
656
495
2540
4173
1226
1111
2946
2051
2938
1740
767
2194
10
1548
583
195
10281
22
350
1427
3829
441
336
2766
846
786
359
1600
1089
4650
5648
2557
113
3505
1905
2756
563
536
2313
517
743
7
669
317
4128
1273
2300
1685
...

result:

ok 100 lines

Test #284:

score: 43
Accepted
time: 53ms
memory: 13972kb

input:

100
91
141154403 518980956 835084369 494134393 518980956 770758847 601556995 75162865 601556995 770758847 75162865 770758847 75162865 770758847 75162865 601556995 75162865 770758847 75162865 770758847 75162865 770758847 601556995 770758847 601556995 770758847 601556995 770758847 601556995 23780154 6...

output:

45
2746
1768
3504
124
1010
146
3233
158
513
125
315
857
271
738
1175
3397
2505
174
1855
1042
805
339
734
6972
74
773
512
2114
1221
1673
330
1888
845
116
865
887
3124
83
837
334
252
968
657
634
97
738
178
187
1467
24
788
3313
347
15
630
945
3
80
77
2773
91
379
243
777
407
100
605
248
2229
922
564
35
...

result:

ok 100 lines

Test #285:

score: 43
Accepted
time: 59ms
memory: 11904kb

input:

100
609
888929838 681000677 342962283 681000677 342962283 681000677 342962283 681000677 342962283 681000677 342962283 681000677 342962283 681000677 342962283 681000677 342962283 681000677 681000677 342962283 342962283 681000677 342962283 681000677 681000677 342962283 342962283 681000677 342962283 68...

output:

47
105
129
204
8
188
27
127
135
414
209
473
115
481
302
105
201
31
343
16
92
122
12
128
37
191
2
11
173
254
24
321
75
241
152
75
46
139
95
368
398
500
616
17
75
94
140
121
13
104
233
67
158
98
54
18
319
482
167
57
264
82
14
431
218
112
90
75
857
377
41
73
156
285
115
73
239
289
100
250
9
211
419
48
...

result:

ok 100 lines

Test #286:

score: 43
Accepted
time: 55ms
memory: 11868kb

input:

100
2798
327713368 673638611 327713368 649434521 327713368 673638611 327713368 649434521 327713368 673638611 327713368 649434521 327713368 673638611 327713368 649434521 327713368 673638611 327713368 649434521 327713368 673638611 327713368 649434521 327713368 673638611 327713368 649434521 327713368 6...

output:

2074
1515
405
2890
306
1187
2226
977
607
1827
4190
207
3696
777
720
416
367
4465
385
475
2106
266
350
3043
750
1640
6829
279
819
871
1092
17
230
456
2958
375
617
2143
5395
4232
6322
1877
660
1445
2753
1099
133
1011
487
408
1178
3056
1115
923
590
496
573
69
100
2205
2906
291
1341
198
1406
519
725
156...

result:

ok 100 lines

Test #287:

score: 43
Accepted
time: 58ms
memory: 8096kb

input:

100
4989
499214889 905917417 499214889 144244970 499214889 144244970 499214889 386090693 499214889 386090693 499214889 386090693 499214889 386090693 499214889 499214889 386090693 499214889 386090693 499214889 499214889 386090693 499214889 386090693 499214889 70599428 499214889 70599428 70599428 4992...

output:

615
252
128
161
591
79
27
88
345
374
48
59
395
339
407
408
56
471
75
79
258
46
8
436
413
200
293
146
391
100
658
754
6
370
1116
70
46
373
258
1
76
155
24
185
140
234
1004
523
302
105
27
43
496
287
201
748
390
649
12
100
18
534
504
13
200
903
113
282
231
193
91
9
33
586
393
38
20
26
31
408
170
718
11...

result:

ok 100 lines

Test #288:

score: 43
Accepted
time: 56ms
memory: 11832kb

input:

100
5331
850774720 245715951 899990549 850774720 245715951 850774720 899990549 245715951 850774720 899990549 850774720 245715951 899990549 850774720 899990549 850774720 245715951 899990549 850774720 899990549 850774720 245715951 850774720 245715951 850774720 899990549 850774720 245715951 899990549 2...

output:

1153
526
738
998
461
838
435
618
2799
563
1537
27
1000
315
447
203
190
234
228
798
1651
131
252
359
477
215
348
365
405
402
57
287
2180
10
677
187
3492
515
441
2154
267
254
40
1240
993
1321
1709
272
212
1009
221
975
178
2019
442
435
341
732
2822
832
310
511
1074
2132
659
400
256
116
905
11
605
75
78...

result:

ok 100 lines

Test #289:

score: 43
Accepted
time: 58ms
memory: 11824kb

input:

1000
86
547953420 985695938 581553083 918235624 824546022 841426703 837738494 327740610 735748950 44907028 163152701 806663634 806663634 442465358 682691835 132120325 230649456 15479446 116769255 866567417 318939173 254099017 306860140 634346318 802379569 502810968 754271250 526047566 947513606 4639...

output:

72
28
191
11
492
104
300
212
339
42
47
301
522
86
61
221
314
14
82
11
100
100
607
226
49
81
396
157
250
34
326
256
123
108
130
73
488
101
181
32
199
250
40
56
31
109
228
116
8
125
288
253
234
19
899
13
10
192
111
393
108
474
81
55
22
560
274
27
26
701
24
33
495
267
125
69
132
30
33
47
233
72
17
58
1...

result:

ok 1000 lines

Test #290:

score: 43
Accepted
time: 63ms
memory: 11884kb

input:

1000
226
643583589 539280724 643583589 250543403 539280724 250543403 539280724 643583589 250543403 539280724 539280724 643583589 539280724 643583589 250543403 643583589 539280724 643583589 250543403 539280724 539280724 643583589 250543403 539280724 643583589 539280724 643583589 539280724 539280724 6...

output:

102
64
21
26
60
20
180
79
245
13
29
11
223
64
212
18
33
79
79
82
19
659
169
212
28
114
82
42
19
37
62
80
102
34
91
152
133
190
143
38
135
164
19
5
46
194
224
302
410
41
62
136
34
330
56
125
48
274
46
90
140
167
32
176
97
83
109
73
50
52
25
55
136
26
2
232
67
49
11
547
19
61
174
48
25
144
351
122
16
...

result:

ok 1000 lines

Test #291:

score: 43
Accepted
time: 55ms
memory: 9756kb

input:

1000
163
446695432 817847865 446695432 817847865 817847865 817847865 446695432 817847865 446695432 817847865 446695432 446695432 817847865 817847865 446695432 817847865 446695432 817847865 446695432 615467656 446695432 528850545 615467656 446695432 615467656 615467656 446695432 615467656 446695432 6...

output:

12
29
2
2
2
22
20
1
10
35
2
17
2
18
9
10
6
27
2
2
20
34
4
35
42
2
2
45
16
18
8
9
3
6
27
132
4
9
31
2
22
5
11
2
5
18
32
17
11
24
2
2
10
38
11
19
13
27
2
7
2
8
2
52
2
4
37
13
17
36
21
68
58
26
6
45
11
12
2
40
15
82
2
2
12
30
22
50
10
12
18
42
20
22
20
2
2
2
4
2
20
7
2
17
10
2
2
15
10
13
5
50
21
1
104
...

result:

ok 1000 lines

Test #292:

score: 43
Accepted
time: 56ms
memory: 11804kb

input:

1000
55
934500306 826255681 934500306 653067228 934500306 826255681 934500306 653067228 934500306 826255681 934500306 653067228 934500306 826255681 934500306 653067228 934500306 826255681 934500306 653067228 934500306 826255681 934500306 653067228 934500306 826255681 934500306 653067228 934500306 82...

output:

41
214
61
122
146
9
203
34
195
41
308
139
291
42
177
672
206
81
41
284
135
211
147
333
77
18
8
30
72
23
68
107
86
38
81
303
194
215
469
145
352
31
153
182
281
212
162
80
100
251
29
108
181
50
61
320
53
46
76
85
684
8
41
184
84
237
27
224
107
265
351
72
28
578
4
8
114
44
490
4
90
138
145
5
34
507
16
...

result:

ok 1000 lines

Test #293:

score: 43
Accepted
time: 60ms
memory: 11756kb

input:

1000
43
807073836 807073836 217608073 807073836 901555829 442043937 901555829 442043937 901555829 442043937 713128031 442043937 713128031 442043937 713128031 758810054 713128031 758810054 713128031 758810054 713128031 758810054 758810054 713128031 758810054 758810054 713128031 758810054 126782394 75...

output:

11
8
6
17
2
2
20
6
4
53
19
3
16
7
62
52
12
51
20
22
7
3
6
16
10
40
21
6
22
30
9
58
69
21
22
71
63
7
26
22
9
39
46
83
17
21
2
52
59
2
61
16
26
29
6
34
4
16
17
9
11
61
45
43
59
4
1
10
35
36
4
97
60
5
34
26
38
3
4
9
4
16
2
27
14
3
33
18
39
2
46
5
40
7
46
25
9
6
4
17
4
22
5
2
74
22
22
33
36
7
15
23
18
1...

result:

ok 1000 lines

Test #294:

score: 43
Accepted
time: 57ms
memory: 11824kb

input:

1000
236
58764077 637258954 58764077 243297400 58764077 637258954 58764077 910715756 637258954 910715756 18255635 910715756 637258954 910715756 18255635 910715756 637258954 910715756 18255635 910715756 637258954 910715756 18255635 910715756 637258954 910715756 439133725 637258954 439133725 451715401...

output:

97
12
59
21
11
14
55
22
17
78
17
148
174
66
35
19
25
1
59
19
171
102
143
362
237
3
576
15
41
36
6
77
25
159
70
18
105
223
97
41
218
162
11
110
15
166
53
36
288
424
105
29
133
120
63
1
36
3
110
61
254
120
68
18
67
10
84
34
22
67
56
76
69
20
4
20
32
97
21
100
209
2
18
29
69
22
9
87
253
77
31
56
55
49
...

result:

ok 1000 lines

Test #295:

score: 43
Accepted
time: 62ms
memory: 9864kb

input:

5000
32
466268311 39982264 981361601 41807534 177338273 603037830 224126369 631685207 506208175 963866461 515226964 188309297 847668740 961826362 311473335 167847779 326624952 26416910 151815612 830117191 990820661 585030972 989473000 561982445 875473085 55932959 681522133 593202069 780557537 438364...

output:

32
16
35
9
37
40
5
134
5
24
25
2
35
8
22
49
4
1
7
10
225
9
24
56
8
51
30
21
23
1
86
34
109
25
58
19
61
31
10
18
6
21
131
111
40
11
17
4
38
9
8
20
165
8
35
1
14
5
17
36
52
44
5
24
90
1
41
37
45
8
3
33
151
3
32
76
6
27
17
209
16
15
5
8
65
62
49
4
14
97
6
242
103
61
26
10
53
12
29
40
44
7
31
35
16
23
1...

result:

ok 5000 lines

Test #296:

score: 43
Accepted
time: 53ms
memory: 9772kb

input:

5000
9
26251097 798139239 400463660 216704908 400463660 918105431 400463660 798139239 400463660
111
624071754 303518321 624071754 303518321 624071754 624071754 624071754 303518321 624071754 624071754 581069141 303518321 303518321 303518321 303518321 624071754 303518321 303518321 624071754 581069141 ...

output:

7
50
7
15
36
9
4
20
32
25
3
27
1
29
20
5
12
3
2
62
13
17
3
20
1
3
21
7
3
61
3
26
8
7
13
5
37
14
19
17
71
9
4
9
68
5
7
63
96
21
32
14
30
20
80
59
4
28
6
18
16
47
10
10
23
8
4
71
16
51
29
9
2
19
32
10
12
27
3
13
20
38
7
7
6
8
1
15
33
30
13
15
23
15
55
12
15
68
31
36
31
38
20
2
31
24
8
8
19
12
17
11
5
...

result:

ok 5000 lines

Test #297:

score: 43
Accepted
time: 59ms
memory: 11760kb

input:

5000
44
883850374 554013557 554013557 883850374 554013557 883850374 883850374 554013557 883850374 554013557 883850374 554013557 883850374 554013557 883850374 554013557 883850374 554013557 883850374 554013557 554013557 883850374 554013557 883850374 554013557 554013557 554013557 554013557 883850374 55...

output:

2
2
5
2
2
2
8
7
1
2
8
2
6
2
2
2
14
10
2
2
25
2
2
2
4
2
12
2
2
4
9
2
2
2
2
2
2
5
2
15
14
2
1
2
5
2
2
7
2
2
18
9
26
2
2
2
28
2
14
2
4
17
14
2
5
2
8
2
3
1
2
2
1
4
18
2
8
2
2
4
5
2
5
4
6
2
2
2
5
2
2
4
2
8
22
2
3
4
2
2
4
2
27
2
8
18
2
5
2
6
2
2
2
4
2
2
2
8
8
7
2
2
2
2
11
4
2
2
2
10
13
2
2
2
6
2
2
2
2
28
...

result:

ok 5000 lines

Test #298:

score: 43
Accepted
time: 57ms
memory: 7676kb

input:

5000
23
70668949 770873185 70668949 363317721 70668949 770873185 70668949 348091621 770873185 348091621 654571050 348091621 770873185 348091621 885631727 770873185 885631727 907286694 885631727 770873185 885631727 87143197 774685053
32
306225150 479394503 306225150 401411983 306225150 479394503 3062...

output:

16
22
29
27
35
33
17
12
41
47
3
53
5
11
29
3
2
34
32
21
21
25
22
19
15
2
24
65
19
59
5
16
40
17
8
21
1
2
18
5
20
37
58
17
24
2
25
33
5
72
46
54
3
31
5
20
1
2
40
36
12
49
95
25
17
42
6
8
37
66
10
7
15
46
1
17
9
83
72
17
17
8
11
17
1
18
27
13
1
72
17
2
26
15
48
3
4
5
4
7
22
15
15
28
47
18
3
21
26
36
6...

result:

ok 5000 lines

Test #299:

score: 43
Accepted
time: 64ms
memory: 9772kb

input:

5000
38
936139290 936139290 936139290 741381352 936139290 741381352 936139290 741381352 741381352 936139290 655802363 936139290 655802363 936139290 655802363 936139290 655802363 936139290 936139290 655802363 936139290 655802363 936139290 655802363 655802363 936139290 655802363 655802363 936139290 65...

output:

5
20
5
12
11
12
23
7
2
8
2
6
6
2
4
9
22
10
9
28
4
8
3
2
2
28
10
4
7
6
5
4
6
4
2
5
24
14
14
6
2
7
8
10
12
7
19
15
14
4
3
19
7
7
2
4
8
7
7
2
3
4
5
2
2
5
9
9
12
9
18
5
2
3
4
3
10
4
2
9
2
9
6
6
6
4
13
4
16
4
12
27
8
2
15
4
4
5
4
2
2
2
8
2
5
12
2
6
6
2
2
2
7
8
15
4
5
4
4
6
4
11
9
6
11
2
1
2
14
11
5
5
2
1...

result:

ok 5000 lines

Test #300:

score: 43
Accepted
time: 54ms
memory: 11824kb

input:

5000
88
839542046 906361767 839542046 906361767 456820306 456820306 906361767 839542046 839542046 906361767 456820306 906361767 839542046 906361767 839542046 906361767 839542046 906361767 839542046 839542046 906361767 839542046 906361767 839542046 906361767 839542046 906361767 906361767 839542046 90...

output:

18
14
39
15
5
5
31
17
13
22
16
23
28
12
28
1
27
16
2
12
13
27
31
52
28
2
29
26
41
28
4
42
40
9
2
58
27
15
16
1
15
23
7
40
10
12
6
23
9
28
34
22
18
3
11
25
12
5
10
15
43
34
12
27
24
6
6
34
20
32
29
21
7
36
7
53
27
63
21
12
19
4
23
51
19
12
19
19
6
16
18
25
7
23
14
30
2
36
11
14
45
4
145
5
2
1
57
46
1...

result:

ok 5000 lines

Test #301:

score: 43
Accepted
time: 71ms
memory: 11884kb

input:

40000
3
583883644 374053145 260180248
4
928279529 321079555 663846614 669298830
15
382313322 267032895 500829795 804205865 847376382 499367776 169642039 770267965 509916264 918716269 123036366 793618201 866549829 866549829 866549829
3
513559990 741627303 200122090
5
372104124 998637332 958029983 899...

output:

3
4
13
3
5
5
4
2
1
2
2
7
1
3
6
4
2
3
5
1
7
1
1
19
3
1
1
25
9
3
19
10
21
3
4
2
1
4
11
2
1
9
1
7
3
1
3
7
12
11
2
5
3
1
3
2
12
6
4
1
5
3
1
4
1
8
2
3
5
7
5
6
2
2
3
9
5
3
4
1
12
9
5
6
2
4
1
5
3
1
5
1
2
7
2
6
6
2
8
2
2
7
4
2
2
8
11
2
6
14
9
10
7
21
2
3
5
1
11
13
6
7
11
9
6
16
2
3
1
4
3
1
2
1
3
2
7
3
1
4
1...

result:

ok 40000 lines

Test #302:

score: 43
Accepted
time: 75ms
memory: 7720kb

input:

40000
5
193695088 857897823 193695088 189127799 857897823
5
762529164 536008902 484595512 919386194 484595512
13
336500424 639036327 336500424 208547470 639036327 336500424 208547470 336500424 336500424 639036327 336500424 208547470 336500424
9
688861253 637589671 688861253 160525866 637589671 95636...

output:

4
4
9
5
12
4
5
1
2
2
8
4
9
1
3
4
3
6
3
1
2
2
4
1
2
3
2
5
4
5
4
2
2
2
1
1
9
8
4
4
2
4
2
1
7
3
6
2
2
3
4
1
9
3
2
4
4
4
1
4
2
2
2
4
7
1
3
3
3
2
3
11
6
1
2
1
8
3
1
15
4
6
4
2
9
7
8
6
1
4
2
3
1
4
3
4
1
1
3
5
3
1
2
5
2
1
1
3
1
2
2
14
6
12
6
3
4
1
2
10
4
2
3
2
3
4
1
3
3
1
2
1
1
7
4
2
3
6
1
2
8
4
7
1
10
2
2...

result:

ok 40000 lines

Test #303:

score: 43
Accepted
time: 83ms
memory: 9704kb

input:

40000
6
361884144 729126914 361884144 729126914 361884144 729126914
5
478427422 902043909 478427422 902043909 478427422
2
887473265 449234137
1
211089437
1
408663850
1
720205715
1
16479924
10
125127193 339050312 125127193 339050312 125127193 339050312 125127193 339050312 125127193 339050312
2
206696...

output:

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

result:

ok 40000 lines

Test #304:

score: 43
Accepted
time: 77ms
memory: 7664kb

input:

40000
9
832022277 576377163 982762469 924093249 428557959 635581134 908788637 676073734 12208157
4
375995759 908582774 138082420 66915276
6
179967775 335539905 190774821 87613997 762674158 67438017
10
534223799 735649882 378583471 724996119 80275299 698887656 698887656 361158310 444527553 288118744
...

output:

9
4
6
9
7
2
1
1
2
1
5
6
1
2
9
1
5
9
6
8
4
2
5
1
2
5
1
8
3
1
13
4
10
1
5
1
2
7
1
6
2
4
5
2
1
7
7
4
7
12
5
8
3
2
3
7
3
3
2
5
7
2
12
1
2
2
1
3
5
4
12
13
6
7
4
14
6
2
11
1
4
2
9
6
10
6
16
4
2
2
1
1
15
3
1
5
2
8
7
16
3
4
4
2
2
4
14
8
5
4
2
16
3
4
1
9
4
2
1
3
4
5
7
1
3
4
4
4
6
5
3
3
3
5
5
3
6
1
1
1
3
1
9
...

result:

ok 40000 lines

Test #305:

score: 43
Accepted
time: 56ms
memory: 7724kb

input:

40000
2
132079228 622053553
4
115334760 793117900 115334760 793117900
4
745182612 680640712 745182612 680640712
2
180016859 161018206
4
75052418 908604629 75052418 510765263
5
792486633 681717142 214502938 681717142 214502938
3
752785401 423373061 423980882
3
963161037 719002206 963161037
4
75244999...

output:

2
2
2
2
3
3
3
2
2
2
1
1
1
1
3
2
1
2
2
2
2
2
2
2
2
1
2
1
2
2
1
2
2
6
1
3
1
2
2
4
2
2
2
1
2
2
1
2
5
1
2
3
2
2
1
2
2
2
2
2
1
2
2
1
2
4
4
3
2
7
2
2
1
2
4
1
1
2
2
5
1
3
2
3
1
2
2
2
1
4
2
2
2
2
2
2
2
1
1
3
2
2
2
2
2
2
6
2
2
1
2
2
1
2
6
2
2
2
2
2
7
2
3
2
2
2
1
2
3
2
2
2
2
5
1
2
4
2
2
2
4
5
2
2
3
2
2
3
2
1
...

result:

ok 40000 lines

Test #306:

score: 43
Accepted
time: 82ms
memory: 7728kb

input:

40000
2
835010935 340247725
9
886467466 642509740 782366239 374510311 142015829 581461874 882700536 69082035 191003052
3
632237650 231047351 488956108
2
327854677 791868255
4
484580946 927583485 695093346 543803790
2
61555848 282769295
4
254636446 67409161 768613122 681802285
3
599003279 364917024 5...

output:

2
9
3
2
4
2
4
2
1
6
1
5
2
3
1
2
11
2
1
5
4
4
4
4
4
4
3
8
4
2
2
1
1
5
12
7
2
9
9
2
1
1
2
4
11
1
1
1
2
7
3
7
2
3
2
2
1
2
3
3
1
9
1
6
1
1
3
3
1
5
5
11
2
2
1
1
3
2
6
6
1
2
11
1
3
3
8
4
2
17
2
2
6
13
2
3
1
5
17
4
3
1
1
1
2
2
4
3
2
1
7
5
4
5
3
10
1
5
5
1
6
3
16
5
3
1
10
2
1
2
2
2
10
4
1
2
9
6
3
2
2
3
1
5
...

result:

ok 40000 lines