QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#455425#64. Naanqiuzx100 ✓335ms67188kbC++201.4kb2024-06-26 13:56:482024-06-26 13:56:50

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 5936kb

input:

2 1516
42058 25892 51128 40494 78380 30332 47660 58339 90812 50469 28184 75581 61837 25051 90975 98279 81022 90217 31015 72984 89884 68399 47215 10071 43418 61089 91302 96661 47701 86531 26050 80503 54870 1405 71971 39883 82485 66816 115 49358 86761 24392 32521 87048 19107 56752 23862 96755 80318 44...

output:

118534088 158076
2 1 

result:

ok good plan

Test #2:

score: 0
Accepted
time: 1ms
memory: 5876kb

input:

2 1695
76378 25507 49544 44950 65160 78873 9386 2835 83577 43277 76229 211 44539 72155 22877 94528 90143 3059 2545 54142 93915 38121 21660 42212 2905 22170 43789 49582 23309 23087 21879 45961 28979 2149 83758 55646 64230 18591 99255 85995 12089 33270 72149 71120 93645 42211 83004 67031 30337 58759 8...

output:

92106216 108896
1 2 

result:

ok good plan

Test #3:

score: 0
Accepted
time: 1ms
memory: 5884kb

input:

2 1896
5656 8488 83550 73597 66974 30814 60595 60681 58121 15839 43067 39354 72302 99482 94940 54418 44486 26825 3593 2745 46490 31847 38002 89179 52576 56052 23613 2386 32515 13670 51023 99869 67448 18185 89358 79676 73441 90660 76289 78975 35379 98098 96191 16119 75401 71516 46141 53036 49002 9248...

output:

131353113 140046
1 2 

result:

ok good plan

Test #4:

score: 0
Accepted
time: 1ms
memory: 5876kb

input:

2 1089
5 4 5 1 5 3 2 4 5 5 1 3 3 1 2 5 4 1 5 5 5 3 1 2 2 2 1 5 2 92110 1 3 2 4 1 1 1 5 2 4 2 3 4 5 2 1 5 3 68199 92895 2 3 2 2 4 3 4 5 2 21113 2 3 2 3 4 2 3 2 3 5 1 2 4 3 4 2 2 4 3 1 5 1 3 2 2 3 3 5 1 2 5 4 5 4 5 2 3 2 5 3 1 1 4 1 3 1 3 4 3 3 2 1 5 3 4 4 5 4 4 4 5 2 5 1 5 4 2 2 3 1 4 1 2 31268 5 1 5...

output:

48326578 108462
2 1 

result:

ok good plan

Test #5:

score: 0
Accepted
time: 1ms
memory: 6120kb

input:

2 207
2 4 5 2 5 5 4 3 53669 1 3 3 2 4 4 5 3 5 4 4 3 2 4 2 4 3 50596 5 4 4 1 5 2 3 5 4 3 2 5 4 5 1 5 5 1 3 4633 2 1 53463 3 5 5 4 4 2 2 5 2 74695 2 55853 90432 5 5 4 1 1 3 2 5 1 2 3 4 2 5 2 1819 1 5 5 1 4 1 3 3 1 4 1 3 3 33131 1 4 4 3 1 1 3 4 2 3 5934 2 3 2 1 1 3 24906 4 1 5 5 4 2 3 2 2 5 2 1 5 1 1 5...

output:

4476566 60118
2 1 

result:

ok good plan

Test #6:

score: 0
Accepted
time: 1ms
memory: 5860kb

input:

2 1484
79520 5 2 1 4 2 4 4 1 5 3 5 1 3 2 3 4 5 2 1 5 5 5 5 3 5 3 1 2 2 4 5 2 4 1 4 5 4 5 29879 36119 5 14571 1 5 5 3 3 2 4 4 5 31580 1 1 1 4 5 4 3 1 4 3 2 5 2 3 1 2 4 4 3 2 35480 1 5 4 4 1 2 2 5 5 2 3 3 4 1 1 4 1 4 5 4 1 1 1 4856 4 3 5 5 5 5 3 3 5571 91607 3273 3 1 4 2 5 63040 5 2 1 3 2 1 2 99930 4 ...

output:

99452768 165386
1 2 

result:

ok good plan

Test #7:

score: 0
Accepted
time: 1ms
memory: 6112kb

input:

2 1644
5 2 4 2 2 3 1 4 3 4 1 4 4 5 1 2 5 2 2 3 1 5 3 1 4 5 5 4 2 5 2 4 5 4 3 5 4 5 2 5 1 3 1 5 2 5 3 2 5 3 5 3 4 3 5 2 5 2 69823 3 4 1 2 2 1 4 1 4 5 4 4 2 2 5 5 5 5 4 4 5 4 2 4 5 3 5 1 5 4 5 4 4 5 3 5 2 2 5 5 1 2 1 2 3 4 3 2 5 3 4 3 3 1 1 4 4 1 3 3 2 2 4 3 2 1 1 5 3 4 1 3 2 2 1 4 5 1 5 4 5 5 5 5 1 5...

output:

8173901 139646
1 2 

result:

ok good plan

Test #8:

score: 0
Accepted
time: 1ms
memory: 5928kb

input:

2 302
5 3 1 1 1 2 1 2 2 3 5 4 3 3 3 2 2 1 2 5 1 3 4 5 2 2 2 2 3 5 5 5 1 1 4 5 3 3 1 2 5 5 5 5 2 1 1 3 4 5 4 4 4 3 3 1 4 2 5 4 2 1 2 4 4 1 1 3 3 2 2 4 1 2 3 5 4 5 3 2 2 5 4 2 1 3 4 3 2 4 5 2 1 2 3 4 1 4 4 3 2 5 2 5 2 2 4 2 5 3 1 2 3 4 5 1 2 2 5 1 1 1 2 5 5 4 5 5 2 1 5 4 1 4 2 2 2 1 1 2 2 5 1 5 2 2 5 ...

output:

24245040 88650
1 2 

result:

ok good plan

Test #9:

score: 0
Accepted
time: 0ms
memory: 5860kb

input:

2 1925
4 2 4 4 3 1 3 5 4 5 3 4 5 4 2 4 2 2 4 3 5 3 2 4 1 4 2 5 5 3 5 3 2 2 4 5 5 3 2 4 3 4 3 5 3 3 3 2 2 1 2 2 5 4 1 5 3 3 3 5 1 5 2 1 3 3 4 1 2 1 3 2 1 5 4 5 4 5 5 5 4 5 2 1 1 3 2 4 4 2 2 4 3 4 1 2 5 1 4 3 4 5 3 1 1 1 2 4 1 1 1 3 2 5 3 3 5 4 4 3 3 4 4 4 3 4 1 2 5 2 4 1 4 5 3 1 4 1 4 4 4 3 3 1 3 1 3...

output:

10770755 54790
1 2 

result:

ok good plan

Test #10:

score: 0
Accepted
time: 1ms
memory: 5812kb

input:

2 1800
19199 26563 12624 27089 2367 1315 38661 2893 38135 29193 24722 6049 22355 1578 9731 9994 33401 6312 29193 15780 34190 26037 30245 12361 1578 28404 13939 17621 22618 31560 17884 21303 10783 30508 30245 19199 17621 35768 23407 526 34979 19988 25774 9205 8153 30245 38135 17358 4734 17358 16306 2...

output:

59495071 65224
1 2 

result:

ok good plan

Test #11:

score: 0
Accepted
time: 1ms
memory: 5816kb

input:

2 2000
4192 45064 45850 23842 8384 20436 262 26986 64190 68120 59212 39038 58688 62356 62880 29344 50304 21222 3930 53186 47160 40610 9170 37990 20960 3930 50042 28820 30916 42968 9170 25938 9432 55020 8384 59474 1572 32226 54758 39562 4716 45326 46898 8646 29606 29606 40086 36156 42706 55544 30916 ...

output:

124644142 123140
1 2 

result:

ok good plan

Test #12:

score: 0
Accepted
time: 1ms
memory: 5864kb

input:

2 1998
56448 17024 54656 74816 41216 22848 70784 12544 46592 51968 37184 41664 35392 25984 10304 11648 41216 62720 36736 80192 37632 65856 57344 48832 44800 17920 13440 4480 42560 68992 8512 21952 67200 50176 73024 7616 17920 45696 44352 68096 14336 38976 35392 50624 53312 50176 33152 67648 76160 41...

output:

79219840 80640
1 2 

result:

ok good plan

Test #13:

score: 0
Accepted
time: 0ms
memory: 5932kb

input:

2 1995
49236 61172 13055 80941 18650 50755 87982 10487 42890 46618 76856 55914 48870 3733 54114 85027 54442 60053 62664 71616 83179 20142 70497 11936 1119 68645 15657 63767 69757 50361 59307 53712 89147 84666 61548 54433 65309 42865 65671 28348 15293 76838 10071 3357 28721 91385 9698 41023 70504 443...

output:

4574282 4554
2 1 

result:

ok good plan

Test #14:

score: 0
Accepted
time: 1ms
memory: 5884kb

input:

2 2000
16800 49200 83600 75200 26106 56355 35939 5600 73609 72391 4400 78000 80000 83600 27200 30000 78800 65200 30800 11200 22000 52400 8800 65200 33200 12800 64370 70830 36400 3600 34400 51200 72333 16867 46800 57600 38000 38000 18400 11154 24046 79200 24400 55200 58800 26458 75542 79200 6400 4760...

output:

115521200 115200
1 2 

result:

ok good plan

Subtask #2:

score: 24
Accepted

Test #15:

score: 24
Accepted
time: 1ms
memory: 5872kb

input:

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

output:

5696 10
2 1 

result:

ok good plan

Test #16:

score: 0
Accepted
time: 1ms
memory: 6172kb

input:

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

output:

5796 20
21354 36
17818 20
1 4 3 2 

result:

ok good plan

Test #17:

score: 0
Accepted
time: 1ms
memory: 6188kb

input:

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

output:

7311 42
19280 54
9783 18
26158 36
54589 60
2 5 1 6 4 3 

result:

ok good plan

Test #18:

score: 0
Accepted
time: 1ms
memory: 6208kb

input:

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

output:

14987 60
12186 24
41517 54
36706 36
61843 48
6 3 2 4 5 1 

result:

ok good plan

Test #19:

score: 0
Accepted
time: 0ms
memory: 5904kb

input:

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

output:

2338 12
19080 48
33222 54
48918 60
61262 60
6 1 4 2 3 5 

result:

ok good plan

Test #20:

score: 0
Accepted
time: 1ms
memory: 5872kb

input:

4 1157
3 2 4 4 4 1 4 1 3 3 3 5 3 5 3 3 6 2 3 2 2 4 2 2 5 1 5 1 5 1 5 2 2 3 1 2 4 2 5 5 2 2 2 2 1 5 3 4 1 5 3 3 2 3 5 4 4 4 5 4 1 3 4 2 3 1 3 5 5 3 4 4 5 4 5 4 2 1 4 1 1 4 2 4 3 4 1 5 5 4 1 4 3 2 3 4 5 3 3 1 3 5 4 5 1 2 3 1 4 5 5 4 2 5 2 2 2 3 5 3 2 2 5 4 5 4 3 1 4 3 2 1 2 1 2 6 4 2 1 3 4 5 4 2 5 1 3...

output:

2262 8
18202 32
17324 20
1 4 3 2 

result:

ok good plan

Test #21:

score: 0
Accepted
time: 1ms
memory: 5832kb

input:

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

output:

3736 6
2 1 

result:

ok good plan

Test #22:

score: 0
Accepted
time: 1ms
memory: 5876kb

input:

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

output:

1301 18
2630 18
4080 18
5490 18
11759 30
6 1 4 3 2 5 

result:

ok good plan

Test #23:

score: 0
Accepted
time: 1ms
memory: 5940kb

input:

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

output:

8492 30
10346 18
15786 18
35566 30
26802 18
4 3 2 5 1 6 

result:

ok good plan

Test #24:

score: 0
Accepted
time: 0ms
memory: 5944kb

input:

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

output:

3303 12
10042 18
10098 12
33540 30
33500 24
6 5 2 3 1 4 

result:

ok good plan

Test #25:

score: 0
Accepted
time: 1ms
memory: 5896kb

input:

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

output:

5119 30
10864 30
9936 18
13208 18
27377 30
4 3 5 6 2 1 

result:

ok good plan

Test #26:

score: 0
Accepted
time: 1ms
memory: 5932kb

input:

4 61
1 3 3 5 2 4 3 2 3 5 4 4 1 5 5 5 3 4 5 5 1 5 5 4 2 2 1 5 2 2 2 1 2 4 4 5 5 3 2 2 1 1 5 2 1 5 5 2 3 4 5 4 1 1 5 1 1 5 1 1 4
2 2 5 4 1 1 4 4 2 1 1 2 1 2 3 3 3 5 4 1 4 1 1 5 5 2 4 5 4 4 5 1 4 4 1 2 5 4 1 4 5 4 2 3 2 4 2 4 3 1 5 4 1 4 5 3 2 10 5 3 3
1 5 3 2 1 1 5 3 3 5 4 3 1 4 4 5 4 2 5 2 1 4 2 2 3 ...

output:

289 20
456 16
580 12
1 4 2 3 

result:

ok good plan

Test #27:

score: 0
Accepted
time: 1ms
memory: 5880kb

input:

4 1361
3 4 1 5 5 2 1 2 2 2 4 1 5 3 4 2 3 4 5 2 1 1 3 5 1 2 1 1 1 2 4 5 4 5 4 3 4 5 3 1 2 2 2 2 2 2 5 5 3 1 1 4 2 2 5 4 4 5 3 5 5 4 1 4 1 3 2 4 4 2 4 5 5 3 4 4 5 1 4 3 4 1 3 2 4 1 1 3 3 2 2 3 5 5 3 4 4 4 1 2 4 2 2 1 5 2 4 2 2 5 3 5 3 3 2 2 5 2 5 5 5 5 3 2 2 2 1 3 5 4 4 4 2 2 3 2 4 3 2 4 4 1 1 1 4 1 1...

output:

4023 12
13494 20
8193 8
1 2 3 4 

result:

ok good plan

Test #28:

score: 0
Accepted
time: 1ms
memory: 5852kb

input:

6 1703
1 5 2 5 2 1 5 5 2 2 2 2 3 5 4 2 4 2 4 2 5 2 1 3 1 4 1 5 4 1 5 2 2 3 5 2 4 4 5 5 5 5 4 1 1 3 2 2 4 1 1 3 3 3 4 4 5 3 5 4 1 1 2 1 4 3 4 2 2 1 1 2 3 2 1 3 1 3 2 5 2 2 1 2 3 2 2 4 4 1 2 2 1 4 4 3 3 5 1 4 4 4 4 4 1 3 1 5 1 4 1 2 5 3 2 2 3 4 1 3 4 2 3 2 1 2 4 3 2 5 5 2 3 4 3 5 4 1 1 5 3 4 1 2 2 2 3...

output:

8503 30
6760 12
5091 6
34054 30
42731 30
6 3 1 4 5 2 

result:

ok good plan

Test #29:

score: 0
Accepted
time: 1ms
memory: 6212kb

input:

6 1454
5 1 5 1 5 2 3 3 5 4 3 3 4 2 1 3 3 3 2 4 2 4 5 5 1 3 2 4 3 5 2 3 3 3 3 1 3 3 1 3 3 1 3 2 2 5 1 3 4 2 1 2 3 2 1 1 4 5 1 1 3 2 4 5 3 1 3 1 1 5 4 5 4 2 1 5 4 3 4 1 5 2 2 2 5 5 3 1 2 2 4 5 3 5 1 5 1 1 5 3 1 2 5 4 1 2 3 1 1 3 1 3 2 3 4 4 1 5 1 2 3 1 5 1 4 1 1 1 1 1 4 1 4 1 3 3 3 3 1 2 5 2 3 5 5 5 1...

output:

5598 24
13978 30
13134 18
17390 18
36293 30
2 4 6 5 1 3 

result:

ok good plan

Test #30:

score: 0
Accepted
time: 1ms
memory: 5924kb

input:

6 1806
1 4 4 4 4 5 5 1 1 2 4 2 1 5 5 5 3 1 2 3 2 5 2 4 2 4 2 5 3 2 5 4 2 4 4 3 1 1 5 4 2 3 4 3 3 5 3 2 3 5 4 1 1 1 2 1 4 2 5 4 5 3 5 2 4 1 3 3 5 3 3 5 1 3 5 2 1 3 5 3 4 2 1 5 4 1 4 4 2 1 5 1 5 1 5 3 3 1 2 5 4 2 1 3 3 1 3 1 1 4 5 3 4 2 4 1 1 3 4 4 2 4 2 3 1 2 4 5 5 4 1 2 3 2 1 5 4 1 3 2 1 4 4 2 2 4 5...

output:

7100 24
3580 6
26877 30
28942 24
36004 24
4 3 5 2 6 1 

result:

ok good plan

Test #31:

score: 0
Accepted
time: 1ms
memory: 6208kb

input:

6 1623
2 3 3 3 1 2 2 3 4 2 4 5 2 2 1 2 3 3 1 3 1 5 3 3 5 2 1 1 1 5 3 5 4 2 3 4 2 5 3 4 3 3 3 5 4 4 5 4 4 5 3 5 2 3 2 5 5 3 3 5 3 3 4 2 1 3 2 5 1 5 4 4 2 2 5 3 1 5 3 4 4 2 4 2 1 3 3 4 2 2 1 2 5 2 3 4 4 4 5 2 5 4 5 5 5 5 5 5 1 1 1 3 5 2 2 1 3 4 2 5 4 3 5 5 5 2 3 2 2 3 2 5 2 4 3 4 3 1 4 1 1 1 2 5 1 1 2...

output:

7756 30
12826 24
19422 24
19410 18
32390 24
3 5 2 1 6 4 

result:

ok good plan

Test #32:

score: 0
Accepted
time: 0ms
memory: 5924kb

input:

6 1993
2 2 2 2 2 1 2 2 2 2 1 2 2 2 1 2 2 2 1 1 1 2 1 2 1 1 2 2 2 2 2 2 2 2 1 2 2 2 2 1 2 2 1 1 1 1 2 2 1 2 2 1 2 1 2 1 2 2 2 1 1 2 2 2 2 2 2 1 2 1 1 1 1 1 2 2 1 1 1 1 1 1 2 1 1 1 1 2 2 2 2 1 1 2 1 2 2 1 1 1 2 2 1 2 2 2 1 2 1 2 1 2 1 2 1 2 2 2 1 2 2 2 2 2 2 2 2 1 1 2 2 2 2 1 1 2 2 2 1 2 1 2 1 2 2 1 1...

output:

3812 12
7822 12
23712 24
39640 30
49700 30
1 2 3 4 5 6 

result:

ok good plan

Test #33:

score: 0
Accepted
time: 1ms
memory: 6212kb

input:

6 2000
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6...

output:

12000 36
4000 6
36000 36
8000 6
10000 6
1 2 3 4 5 6 

result:

ok good plan

Test #34:

score: 0
Accepted
time: 1ms
memory: 6160kb

input:

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

output:

3924 10
23772 30
23624 20
47424 30
5 1 2 3 4 

result:

ok good plan

Test #35:

score: 0
Accepted
time: 2ms
memory: 7996kb

input:

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

output:

15692 48
39710 60
29745 30
40114 30
79948 48
1 2 3 4 5 6 

result:

ok good plan

Test #36:

score: 0
Accepted
time: 1ms
memory: 5948kb

input:

6 2000
9 9 9 9 9 9 10 8 9 9 9 10 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 8 8 8 9 10 10 10 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 8 9 9 9 9 9 9 9 9 9 9 9 9 9 10 8 9 9 9 9 9 9 ...

output:

18000 54
16000 24
12000 12
48000 36
9998 6
1 2 3 4 6 5 

result:

ok good plan

Test #37:

score: 0
Accepted
time: 1ms
memory: 5860kb

input:

3 8
1 2 1 2 2 1 2 1
2 1 2 1 1 2 1 2
2 4 4 2 2 4 2 4

output:

15 6
30 6
2 1 3 

result:

ok good plan

Test #38:

score: 0
Accepted
time: 1ms
memory: 5868kb

input:

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

output:

9050 25
18200 25
21910 20
14720 10
1 2 3 4 5 

result:

ok good plan

Test #39:

score: 0
Accepted
time: 1ms
memory: 5844kb

input:

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

output:

13708 32
34170 40
10397 8
1 2 3 4 

result:

ok good plan

Test #40:

score: 0
Accepted
time: 1ms
memory: 6140kb

input:

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

output:

8715 10
1 2 

result:

ok good plan

Test #41:

score: 0
Accepted
time: 0ms
memory: 6188kb

input:

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

output:

5268 15
35285 50
21156 20
14208 10
1 2 3 4 5 

result:

ok good plan

Subtask #3:

score: 71
Accepted

Test #42:

score: 71
Accepted
time: 28ms
memory: 19388kb

input:

563 467
8049 85539 27182 28071 94216 41847 50021 12220 27028 36160 7314 23133 44548 80654 65291 17329 61691 98590 68874 59735 6789 7383 17300 46373 35858 95819 15891 55598 25928 20662 99160 79046 1004 1901 33290 20640 86369 3246 36921 56090 11582 48092 48473 32198 80924 42208 80056 24593 43827 68820...

output:

22348400 56010618
44837792 56053406
68854267 55673944
93215158 53267119
99917765 44916703
132106351 47920308
183546783 56230188
218158172 54890811
185721461 40219031
235965024 44658849
275185257 47523393
260200404 39855333
160597838 22559973
370281996 48089208
449162366 53959609
387220215 42937195
4...

result:

ok good plan

Test #43:

score: 0
Accepted
time: 176ms
memory: 48872kb

input:

1366 1257
52518 80009 48412 20437 83305 26867 69337 71593 7693 67667 97971 70439 22730 28465 48153 21841 82043 29245 52621 14973 60960 33492 98814 50223 73773 41144 3604 73526 5517 6397 76361 21299 35385 31974 51659 51949 13259 2630 82701 11777 34685 80651 10052 8110 36082 39167 88620 98236 3962 503...

output:

61247078 136526236
122140594 136130096
190049789 135653362
247538398 131645518
292191858 123692666
389791788 134620666
435296429 126945112
356913310 83851910
649915178 135918366
720258406 135645166
745467682 125702052
720660012 104012704
882701887 116471990
1118054788 133032008
1213651591 136281722
...

result:

ok good plan

Test #44:

score: 0
Accepted
time: 85ms
memory: 26920kb

input:

690 1866
85792 92334 50551 48051 90530 95125 96811 34670 49217 87825 26495 38978 68460 38876 38857 27803 28417 1805 37912 11112 69602 58726 74906 24482 23332 85335 61653 83174 42938 95270 28423 97755 58360 64911 89830 62190 30657 60857 279 35336 89847 10067 71661 57116 14473 5130 7740 65281 11859 16...

output:

89607952 64788240
209220762 68586000
150235131 30849210
357372926 54998520
563073375 63330270
520432404 46799250
339734492 25467210
634173858 38622750
1267727922 68370720
1299548480 63272310
1269856190 55407690
1328521494 53090670
1877981239 68184420
1141404028 38203230
2066700105 63481380
175261027...

result:

ok good plan

Test #45:

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

input:

120 1641
79533 4616 99240 61065 12661 68564 56220 38422 29259 44471 18466 60650 31236 85811 53461 35262 84149 86402 20219 52122 33390 71427 14689 21333 58989 36999 21782 95540 42645 23935 6410 54667 64280 89935 11448 29739 72262 39244 20237 95857 28793 71700 55654 29845 97155 56453 56786 69842 99775...

output:

101348866 11156760
181235486 9333120
371899446 11911440
320517544 7084440
614279825 11039400
354164346 5101680
916330022 10909560
367198592 3631440
1000523085 8880840
448345540 3602400
1421809328 10249200
1569621888 10286400
1779612485 10667520
730676900 4064280
2153904675 11178120
669577152 3258240...

result:

ok good plan

Test #46:

score: 0
Accepted
time: 115ms
memory: 37572kb

input:

983 1432
37505 3989 77187 24252 51178 28824 31852 32234 32855 8118 54490 55655 70642 5003 53629 99535 74578 40375 76797 70727 14079 79277 2353 26138 19066 42268 36483 95370 28139 95095 78828 87651 16152 31182 68106 52713 83949 11493 93311 56907 42793 1502 34732 92867 16494 69850 49 93950 87357 78602...

output:

69883301 97624679
144919179 97187244
222722806 95995848
242550722 76117622
388654089 98142720
404362746 77449587
504197165 80023081
334580999 44367705
733224954 87360193
862923132 91821047
996021201 90555926
945410514 79086282
1036596857 77235293
1377000245 94336544
1332220549 84017010
1473511662 87...

result:

ok good plan

Test #47:

score: 0
Accepted
time: 232ms
memory: 54268kb

input:

1874 457
3 4 2 5 4 2 3 2 2 71353 2 1 5 34524 4 2 3 5 4 1 4 2 2 5 5 2 2 3 2 3 1 3 2 4 64052 1 3 3 5 5 2 2 4 1 5 2 5 1 16315 3 3 1 93056 2 2 4 2 2 3 2 5 2 2 4 2 4 3 3 3 5 4 5 5 3 1 4 3 2 2 2 1 2 4 4 3 1 96655 1 1 4 1 1 3 5 3 2 5 3 4 2 5 5 1 2 3 1 1 5 4 5 3 3 2 4 1 3 1 1 5 4 5 3 2 2 5 4 2 5 5 3 2 5 5 1...

output:

517251 159527998
1662736 176555162
1950165 130973860
3151604 146706090
4820715 179272462
5830944 180366878
7190449 186491110
7598816 170132964
8760915 172713462
8526800 150800780
8676030 137146816
12623124 160221378
15491333 175621910
16171428 166055140
13945980 131644752
15420608 134971102
21168468...

result:

ok good plan

Test #48:

score: 0
Accepted
time: 57ms
memory: 29492kb

input:

864 590
4 2 5 3 3 3 1 4 2 3 5 3 2 5 3 4 10859 2 1 4 2 5 2 1 4 2 2 5 5 5 3 5 1 4 5 4 3 2 2 4 3 3 4 3 2 1 3 2 2 5 3 4 6444 5 4 2 2 5 2 3 1 22444 4 3 2 1 2 2 2 5 2 4 1 3 3 4 5 2 3 2 1 1 5 2 1 4 2 3 3 5 3 4 1 1 4 30271 1 3 5 2 3 4 1 4 4 2 5 4 4 3 1 4 5 3 2 4 4 2 4746 4 4 4 2 1 34523 4 5 4 2 3 3 1 4 5 4 ...

output:

1030570 49207392
2766866 64805184
2914107 41153184
4770504 47633184
9558085 76005216
9969618 65574144
8272033 45099936
13379920 60626880
16822719 66439008
20052000 70606944
18989047 57119040
16513116 34807104
25717484 48095424
20657728 32925312
15373125 21691584
31217328 39634272
20829845 22299840
9...

result:

ok good plan

Test #49:

score: 0
Accepted
time: 335ms
memory: 65464kb

input:

1971 1294
5 5 1 68003 4 3 5 3 4 4 4 3 1 2 1 5 1 3 27223 3 2 3 4 4 2 4 2 1 3 4 2 1 1 1 1 4 2 5 5 1 1 3 3 5 4 3 3 5 5 2 1 5 4 3 1 5 64583 4 3 3 4 3 1 1 67003 5 3 4 5 3 1 1 1 2 3 2 4 2 5 2 3 2 1 2 3 3 5 3 1 5 4 2 2 1 52723 5 79018 2 3 5 1 2 2 3 1 5 3 1 1 2 1 1 4 3 4 1 5 3 2 24651 4 2 2 3 2 1 2 2 5 2 4 ...

output:

2626452 187757460
5619432 178020720
9323028 196504758
11869564 186566976
15196350 182079009
15025266 149715189
23584225 196835886
23458784 166807701
27513504 172890207
28561060 152931861
35670547 171593289
44320896 194693409
48311159 193694112
52004148 189204174
57726420 191496447
61122768 190047762...

result:

ok good plan

Test #50:

score: 0
Accepted
time: 124ms
memory: 39976kb

input:

1042 1653
1 18448 3 4 5 5 5 5 2 4 3 1 4 4 4 1 5 2 5 2 5 1 2 3 2 5 4 4 3 2 5 2 3 5 4 1 5 3 5 1 5 95349 5 2 6931 64678 3 5 4 1 5 4 5 3 2 3 1 4 1 1 3 5 3 5 4 3 1 3 5 27958 3 2 3 5 4 1 5 2 5 5 62629 1 5 67503 3 2 4 2 3 37459 1 5 5 2 4 4 1 2 5 5 3 2 3 3 5 3 4 6106 3 2 5 3 2 2 3 4 2 2 2 2 2 2 5 5 4 4 2 1 ...

output:

3856263 103973886
6975818 93612238
12763587 92334746
15212980 78228150
20566745 80599742
24096882 77837400
35789747 96857026
31842896 73859044
39277467 75258450
42593620 71645836
54610545 83382924
54698148 72576342
55739697 61247718
144819240 97698962
155225511 101740880
161996428 97646862
155970182...

result:

ok good plan

Test #51:

score: 0
Accepted
time: 309ms
memory: 61580kb

input:

1712 1904
4 1 3 3 4 1 5 4 4 1 3 2 4 2 1 1 5 1 3 3 4 5 2 5 5185 4 3 5 2 1 3 3 1 3 2 1 4 3 4 5 3 5 1 5 5 4 5 5 3 2 1 4 4 4 8382 4 1 64728 1 4 1 3 3 3 3 1 3 1 5 5 2 5 5 3 4 5 5 2 2 2 5 5 5 4 5 3 3 5 3 5 3 5 5 2 4 2 3 4 3 3 3 5 4 5 2 5 5 1 2 2 1 3 1 2 2 5 3 3 5 3 2 1 3 2 2 4 53897 1 4 3 41944 1 3 1 3 5 ...

output:

3452856 136971984
8778862 171182880
14159454 167805104
17281836 149002208
20493305 140755504
25314642 143400544
33871502 163915440
38900200 161056400
43507800 156067632
42499170 130615328
52268909 144170944
47115192 116729296
75170836 169780752
61037718 127787104
71959800 140490144
69288256 12596382...

result:

ok good plan

Test #52:

score: 0
Accepted
time: 266ms
memory: 59100kb

input:

1684 1347
1 5 4 4 1 4 1 4 4 57088 5 2 4 1 4 5 4 2 1 4 4 1 4 2 4 5 81114 1 3 1 3 1 4 2 4 1 1 1 1 4 2 2 1 3 5 2 5 2 2 4 5 5 4 1 3 1 1 1 3 2 5 3 2 4 4 3 3 5 2 1 5 5 4 62532 2 2 1 4 1 5 87652 5 3 5 98954 5 1 4 3 2 2 3 2 3 2 4 3 2 3 1 5 4 94648 72837 3 4 1 2 1 2 1 3 5 3 4 2 5 3 3 2 4 2 3 2 9563 56570 3 3...

output:

2595189 167490640
4935834 135142684
8914968 159227252
13366100 167830808
14973145 148762876
20474712 165658448
23704527 163523136
26123128 156684412
30345795 159562368
30031330 141301072
34827485 147777736
45805476 167131948
46183163 154700660
51782458 158275792
50531355 140198052
57203024 147841728...

result:

ok good plan

Test #53:

score: 0
Accepted
time: 0ms
memory: 6192kb

input:

4 1989
1 4 2 1 2 3 1 1 3 2 4 5 3 5 2 2 1 5 4 1 3 4 2 5 5 3 1 5 3 3 1 3 2 1 3 5 2 3 4 3 2 5 2 5 5 3 4 2 1 4 4 5 1 3 3 4 2 4 2 1 4 1 4 4 5 3 4 3 1 3 1 3 3 4 4 4 1 3 4 5 4 5 2 4 1 4 3 1 1 5 1 1 4 4 4 1 2 2 2 2 2 2 1 1 5 2 3 3 1 2 5 2 4 3 3 4 4 2 4 4 2 2 4 3 5 1 3 5 1 4 2 2 5 2 3 2 2 4 4 2 1 5 5 2 2 5 3...

output:

28374911 33936
280269382 335048
308497740 368676
4 3 2 1 

result:

ok good plan

Test #54:

score: 0
Accepted
time: 75ms
memory: 37240kb

input:

1404 108
4 2 3 4 4 2 2 3 2 2 2 3 4 4 3 2 5 1 4 3 2 2 2 4 4 1 4 1 3 5 2 4 3 5 5 2 3 2 4 2 3 3 2 5 2 2 2 3 5 3 2 5 1 5 3 4 5 1 2 1 3 5 2 3 2 5 5 4 5 5 4 2 3 1 2 4 2 3 4 1 3122 4 4 3 5 3 2 3 1 1 4 4 2 4 1 3 2 4 2 1 4 3 3 5 4 2 1 5
1 5 4 1 4 2 1 4 2 2 4 5 2 5 1 2 2 3 5 5 1 5 4 2 2 5 1 4 5 1 5 2 2 5 1 3 ...

output:

375 5616
1136 5616
2517 7020
3820 7020
3595 4212
6072 5616
6910 5616
11084 7020
3501 1404
19618 7020
21965 7020
24192 7020
21983 5616
32110 7020
23394 4212
42772 7020
46663 7020
30780 4212
46857 5616
49064 5616
65355 7020
41906 4212
73526 7020
46752 4212
80438 7020
69992 5616
38475 2808
41272 2808
2...

result:

ok good plan

Test #55:

score: 0
Accepted
time: 133ms
memory: 47012kb

input:

1294 1689
1 3 3 2 3 1 1 4 2 4 4 5 4 4 2 5 5 5 3 5 3 3 2 2 2 1 1 1 4 2 5 3 3 1 5 2 2 3 5 1 4 3 1 3 3 3 5 5 3 5 3 4 4 1 3 5 1 3 4 2 4 4 4 2 5 4 3 3 5 5 5 5 4 2 3 4 4 5 3 1 4 3 3 3 2 4 4 5 2 3 5 5 4 4 1 2 2 1 2 4 5 1 2 3 1 5 2 1 3 4 3 4 3 4 3 2 3 4 1 2 5 4 3 4 3 1 2 5 1 3 4 1 3 5 2 2 2 1 4 5 2 2 2 5 4 ...

output:

5356 6470
10232 5176
19764 6470
27138 5176
31880 5176
53238 6470
59723 6470
14356 1294
79994 6470
93452 6470
86238 5176
98800 5176
129926 6470
145914 6470
154533 6470
135616 5176
108887 3882
155828 5176
125298 3882
87358 2588
186742 5176
197284 5176
265739 6470
165718 3882
172003 3882
242262 5176
12...

result:

ok good plan

Test #56:

score: 0
Accepted
time: 123ms
memory: 42932kb

input:

1206 1397
2 3 4 2 4 2 2 2 2 4 3 1 2 3 3 3 5 3 3 4 4 3 1 1 4 1 4 2 2 3 3 1 3 5 2 2 4 4 5 5 2 4 5 5 1 1 4 5 3 2 4 2 5 1 3 1 3 2 3 4 4 5 2 5 3 3 2 5 4 4 2 2 1 5 3 5 5 5 3 2 1 4 4 4 2 3 1 3 1 3 4 2 2 5 4 3 1 3 4 2 5 1 4 5 4 2 4 5 5 4 2 2 1 1 3 1 1 1 2 2 1 1 2 2 3 5 2 1 1 4 5 1 5 5 2 3 4 1 3 1 1 1 3 2 4 ...

output:

4233 6030
9098 4824
17871 6030
16134 3618
33067 6030
42894 6030
39297 4824
43932 4824
63027 6030
46216 3618
17477 1206
77514 4824
104431 6030
90420 4824
130365 6030
142328 6030
65634 2412
138762 4824
186297 6030
197968 6030
216615 6030
225802 6030
238492 6030
250140 6030
54154 1206
223726 4824
17530...

result:

ok good plan

Test #57:

score: 0
Accepted
time: 194ms
memory: 59236kb

input:

1701 1161
1 3 5 1 3 1 4 3 4 4 3 4 5 3 3 1 2 1 2 3 1 4 3 4 4 1 2 5 4 5 5 2 2 3 2 4 4 2 3 1 4 2 2 5 5 4 4 4 1 4 2 3 2 2 3 3 2 4 3 3 5 3 3 4 2 4 5 4 1 1 5 3 2 1 2 4 2 1 4 5 5 2 5 5 2 4 4 3 3 4 1 2 3 1 5 2 3 1 3 1 3 1 5 4 2 1 1 5 2 4 3 1 4 3 1 1 4 5 4 5 2 4 3 5 3 1 3 4 5 2 1 4 3 5 3 1 4 2 1 1 2 3 4 4 3 ...

output:

3981 8505
5199 5103
14553 8505
17436 6804
23838 6804
7344 1701
34076 6804
47357 8505
48915 6804
65696 8505
72672 8505
82776 8505
91499 8505
77126 6804
103416 8505
110695 8505
114982 8505
126774 8505
27778 1701
117450 6804
159411 8505
166982 8505
108920 5103
190620 8505
82483 3402
169575 6804
136998 ...

result:

ok good plan

Test #58:

score: 0
Accepted
time: 135ms
memory: 41156kb

input:

1117 1900
4 2 2 5 5 2 4 4 3 5 4 5 3 3 5 5 3 4 2 1 2 2 2 5 1 2 4 5 3 5 2 5 3 5 1 3 1 5 1 4 4 5 5 5 3 2 3 1 2 5 2 3 1 5 5 1 3 4 2 4 3 4 1 3 4 3 5 5 1 4 4 1 2 1 3 2 1 5 1 3 3 3 5 3 3 2 2 3 1 2 4 2 2 5 4 1 4 3 5 2 1 1 2 5 5 1 5 2 4 2 3 5 1 3 1 1 4 4 4 4 4 1 4 3 1 5 3 5 3 1 5 5 2 2 2 2 3 5 1 5 2 2 5 1 3 ...

output:

6232 5585
12206 4468
14945 3351
38433 5585
48961 5585
33613 3351
68070 5585
86908 5585
100385 5585
86708 4468
131399 5585
114944 4468
123225 4468
136283 4468
118923 3351
210351 5585
223222 5585
195145 4468
152975 3351
215734 4468
234944 4468
262960 4468
212337 3351
296402 4468
309961 4468
243024 335...

result:

ok good plan

Test #59:

score: 0
Accepted
time: 253ms
memory: 66976kb

input:

2000 1993
20720 19943 37037 36519 48174 62678 39886 49728 32375 5180 61124 5957 36778 42735 1036 45584 15281 19943 39886 60606 11396 24346 8029 30821 55944 27713 35742 27713 31598 33152 5180 44289 2849 7511 18648 44807 42476 39368 11914 55426 5957 6216 36260 24346 54649 4144 9324 54131 51023 26159 2...

output:

59744024 38654000
180543616 69212000
155513448 44838000
343314832 80724000
418181480 85188000
878468096 161656000
396635184 66792000
197970432 29568000
933773064 126336000
24122880 3000000
131499304 14440000
581537984 55696000
822397608 75048000
1373566688 108772000
832531680 62040000
394004416 2604...

result:

ok good plan

Test #60:

score: 0
Accepted
time: 272ms
memory: 67036kb

input:

1998 2000
56826 37422 66759 48510 12705 45738 5775 57981 18480 21483 42273 21714 30261 21483 7854 43428 6237 46200 56133 39963 38115 24717 37884 42735 71379 39501 9933 45738 43890 45738 49665 36498 17325 67683 1155 38115 67683 693 61677 9471 11781 32802 47355 42042 10626 8316 55209 24024 19404 50358...

output:

73857738 114521364
128654640 89334576
251670510 112597290
225064560 80839080
288761736 83496420
10585800 2197800
243408522 42329628
735748800 100299600
115876170 14543442
139617786 14307678
891747708 82998918
771879780 63602334
616582764 45710244
358884024 23288688
984197952 57542400
1752165030 9790...

result:

ok good plan

Test #61:

score: 0
Accepted
time: 301ms
memory: 66728kb

input:

1993 1995
56244 38259 44145 43491 38913 10464 44472 52647 30411 3270 49050 16350 26487 34989 64746 17658 39239 47416 15369 22236 24525 981 44145 50358 62130 56244 16022 62457 35317 327 4251 26487 59841 25179 14714 1636 58860 18312 11118 33027 44472 47088 11445 37278 57225 28776 25179 20928 30739 817...

output:

4769027 7884308
917242 701536
1750547 807165
3164123 1076220
3939708 1058283
312889029 68541263
1652736 269055
5608157 811151
575947920 76046901
34172974 4077678
324582070 31688700
480608268 43945650
8151388 649718
11653397 854997
16987811 1185835
23470510 1580449
23172493 1432967
29494751 1731917
2...

result:

ok good plan

Test #62:

score: 0
Accepted
time: 296ms
memory: 67188kb

input:

1999 2000
14373 28746 33537 33537 81447 86238 62283 47910 19163 23956 38328 76656 14373 47910 23955 4791 86238 57492 23955 62283 9582 23955 57492 81447 23955 43120 81444 4794 14372 62283 33537 62283 9582 43119 4791 4791 19164 71865 47910 28746 14373 86238 71865 23955 19164 33537 14374 81449 33534 47...

output:

20056278 9613191
225898524 65319324
498135552 114726608
663001976 135116408
1069271865 196353774
486870872 81427266
229126122 34146918
410513844 54132920
145682 15992
5676000 527736
248534147 21653168
104624730 8425785
1209218712 87716120
1012604250 62968500
1573488560 94704624
1178249612 68413776
6...

result:

ok good plan

Test #63:

score: 0
Accepted
time: 269ms
memory: 66812kb

input:

2000 2000
13325 37375 64675 64350 4550 26975 43875 60125 2275 28600 16900 70525 52000 43875 51350 31525 70850 34775 50700 55900 7800 72799 50701 93600 41275 9750 46150 34450 77675 51025 35750 92950 90675 24700 21775 7475 64674 38026 25675 86452 7148 57850 2925 42575 73775 58500 85475 77025 52650 438...

output:

100007695 51290000
182268240 66864000
320019640 91872000
145453320 26892000
517540300 76680000
59278590 7770000
412514690 41888000
14831160 1302000
872141625 72000000
1114421400 85320000
473938190 33496000
773635540 51022000
782544950 47960000
32764590 1926000
1021190525 55848000
264537600 13760000
...

result:

ok good plan

Test #64:

score: 0
Accepted
time: 227ms
memory: 66884kb

input:

1999 2000
9 5 6 10 4 10 4 10 6 2 10 2 6 8 2 2 8 2 10 8 8 8 4 10 2 9 12 7 4 4 6 10 2 8 8 8 6 10 8 4 2 2 4 8 2 8 6 10 4 10 10 8 2 6 8 2 6 4 3 11 8 6 10 8 6 10 11 3 10 10 8 6 8 4 3 10 7 7 1 4 6 6 4 3 11 8 1 5 4 10 6 8 6 6 6 2 8 8 4 2 6 4 4 2 8 4 10 4 4 10 6 2 4 6 4 2 2 6 2 4 10 6 4 2 2 2 6 10 4 10 8 8 ...

output:

355709 33983
271638 11994
535506 15992
365000 7996
338309 5997
1718688 25987
754692 9995
1063833 11994
814914 7996
232840 1999
1041731 7996
1742224 11994
1861599 11994
1977150 11994
2794037 15992
5495442 29985
3496329 17991
830906 3998
3484874 15992
2296764 9995
4828002 19990
2025491 7996
2118740 79...

result:

ok good plan

Test #65:

score: 0
Accepted
time: 218ms
memory: 67068kb

input:

2000 2000
2 10 8 4 8 2 10 4 10 6 10 10 8 6 59358 10 2 2 6 10 2 10 10 8 5 9 10 2 6 9 5 12 10 10 6 8 8 10 4 10 4 10 5 11 5 1 4 10 4 6 10 8 2 4 4 2 4 4 10 8 6 6 10 8 8 2 8 8 6 2 13 1 8 6 6 10 4 8 10 10 4 2 6 8 6 10 10 8 8 4 2 3 11 8 8 2 6 2 6 2 6 2 8 2 10 2 10 4 8 10 8 6 10 6 8 8 8 6 8 4 8 2 8 4 4 4 8 ...

output:

2493187191 178074000
1662421588 118716000
831359191 59358000
831507588 59358000
1663311970 118716000
1663608764 118716000
2495858337 178074000
1664202352 118716000
2496748719 178074000
2497193910 178074000
1665092734 118716000
2498084292 178074000
2498529483 178074000
1665983116 118716000
833139955 ...

result:

ok good plan

Test #66:

score: 0
Accepted
time: 231ms
memory: 66944kb

input:

2000 2000
2 3 3 3 2 1 6 2 4 2 2 4 1 1 4 4 5 3 2 2 3 5 3 2 1 3 4 6 1 1 5 5 4 1 2 5 4 3 1 5 3 2 1 1 4 1 4 4 2 1 2 5 2 5 2 4 3 3 2 5 3 1 4 3 5 4 1 4 1 1 1 5 2 4 2 5 3 2 1 5 3 1 2 1 6 5 5 2 2 5 5 1 1 2 3 6 2 3 3 5 5 4 1 5 2 4 5 5 1 4 4 2 3 2 1 4 1 1 4 1 3 5 5 1 2 1 1 4 3 4 1 5 1 2 1 3 3 5 4 1 4 1 6 2 2 ...

output:

50616 12000
199848 24000
51848 4000
229232 14000
324540 16000
143848 6000
221156 8000
632928 20000
347772 10000
387080 10000
354388 8000
1049392 22000
627004 12000
556312 10000
1195240 20000
126928 2000
1076472 16000
289544 4000
1517704 20000
1760480 22000
337468 4000
1042776 12000
2718252 30000
133...

result:

ok good plan

Test #67:

score: 0
Accepted
time: 92ms
memory: 48708kb

input:

1382 1191
299 138 253 322 23 299 368 391 46 253 437 46 230 345 322 69 207 207 184 299 253 184 460 207 414 115 322 207 414 276 115 138 115 414 322 207 138 276 207 69 230 345 23 115 161 92 161 207 276 299 391 345 207 368 92 207 322 299 138 92 276 460 391 391 230 138 460 230 161 460 391 161 299 46 345 ...

output:

320684 467116
449820 248760
1810512 668888
3032320 890008
293940 63572
1016440 179660
555416 88448
2116632 309568
4676292 634338
3339540 422892
7198300 760100
4803480 472644
2233552 210064
1555418 129908
6055400 469880
1121056 82920
9563750 677180
8281936 561092
3240960 199008
6017032 348264
202352 ...

result:

ok good plan

Test #68:

score: 0
Accepted
time: 119ms
memory: 46248kb

input:

1239 1740
156 180 228 144 168 240 12 216 228 96 180 96 156 240 144 84 12 144 60 216 120 84 168 84 204 96 204 144 60 96 132 168 192 36 144 132 108 36 91 5 36 72 168 180 240 72 120 240 120 60 108 84 96 108 96 96 24 204 48 108 180 36 84 204 228 168 96 204 156 84 192 144 24 144 156 228 216 240 120 72 24...

output:

376848 334530
2415994 1153509
338820 117705
3225290 797916
2640603 520380
3605025 619500
2195102 289926
6705616 800394
2790630 297360
9910450 929250
3325268 273819
13399251 1015980
7250649 520380
2244578 147441
6054543 341964
19422810 1003590
11332620 557550
18769107 849954
6666726 286209
18124400 7...

result:

ok good plan

Test #69:

score: 0
Accepted
time: 116ms
memory: 53300kb

input:

1574 1132
81 351 405 5 157 432 432 513 540 297 459 27 297 486 540 54 405 270 486 27 270 351 459 27 432 54 459 243 243 108 81 135 459 513 81 297 54 189 405 270 486 270 486 378 459 54 486 108 297 486 378 189 540 540 81 540 27 432 351 216 189 108 459 378 486 378 81 513 54 486 54 54 81 351 17 145 432 27...

output:

416325 306930
1073790 552474
987377 401370
560768 188880
4215981 831072
1677264 302208
5464332 906624
5896872 906624
3692157 528864
9056326 1226146
931604 119624
6952716 849960
2156184 251840
12106134 1353640
2490885 259710
2997654 294338
5975109 561918
2917600 242396
4408300 346280
1502656 113328
8...

result:

ok good plan

Test #70:

score: 0
Accepted
time: 172ms
memory: 56724kb

input:

1589 1929
506 230 368 460 828 828 414 184 736 322 598 690 690 552 874 230 644 644 690 230 828 92 598 276 828 460 230 184 322 184 644 414 644 322 460 276 506 92 276 552 506 782 828 322 414 460 874 874 414 276 598 690 690 736 644 874 276 644 414 92 736 184 828 782 690 138 506 368 92 920 598 690 552 73...

output:

395863 293965
1350000 429030
1574053 371826
4239420 858060
5977239 1058274
1439610 214515
7886032 940688
1883880 200214
6606990 619710
6059328 524370
3547884 286020
10664598 800856
19344330 1358595
10352461 694393
12060378 734118
12342368 711872
7387078 405195
1834284 95340
14069520 686448
18283880 ...

result:

ok good plan

Extra Test:

score: 0
Extra Test Passed