QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#677837#179. Placing Medals on a Binary TreeyellowbirdAC ✓48ms13216kbC++201.3kb2024-10-26 13:31:362024-10-26 13:31:36

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 20ms
memory: 11016kb

input:

210737
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 210737 lines

Test #2:

score: 0
Accepted
time: 27ms
memory: 10864kb

input:

281539
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 281539 lines

Test #3:

score: 0
Accepted
time: 32ms
memory: 11012kb

input:

265167
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 265167 lines

Test #4:

score: 0
Accepted
time: 30ms
memory: 11144kb

input:

333690
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18
18...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 333690 lines

Test #5:

score: 0
Accepted
time: 18ms
memory: 11008kb

input:

234760
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17
17...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 234760 lines

Test #6:

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

input:

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

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 100000 lines

Test #7:

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

input:

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

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 100000 lines

Test #8:

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

input:

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

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 500000 lines

Test #9:

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

input:

156635
67
313426549
216447
14
63
170597
191612
423840
344598777
667995598
248803
8
21
144749
158514
394396
40
206513
229023
477498
492520
18
842338339
27
30
88
6
197902
469043970
23572
409465
340370
3
15
71629
178762
462105693
601752563
34
457368961
9
46
71
17
3
52
49
96
76
69
668463623
79
55
1
4065...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 156635 lines

Test #10:

score: 0
Accepted
time: 42ms
memory: 13108kb

input:

404140
1
318525
9
17
38
410611963
8
35044
406262
128870809
68
2
28
54
676740072
42
486195702
56
466215
47691
304664
74
91
352924
262074
137788
349594
78525
37
409921227
290111
43
359246
27
9131
459302
70
6
61
93
295783
4
9
241399
43602
336353
42472
89
723969735
8
46
1
353091
66
66868
401543
141080
8...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Y...

result:

ok 404140 lines

Test #11:

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

input:

156473
88
374635
94
21
394240
707557328
4
54
74
393914
1
793757782
40951
25
35
86
250997
999047613
46645
134655
38872
26
219099
297636
384507
231634
9
93867
47
63829
345764
443631
329979
344571
75
424559
15
16
64
5
358002
977679510
98
373262
377250
75
23
27596
65387
8
23
79
313166192
29
71
46907
45
...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 156473 lines

Test #12:

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

input:

58682
62
6
277300
330707
31901
94
409572
123750
59
16
261078
247655
37641
69
244300
83539
368828
99
80
49
195933
38
299780
53
364100
177504
2
581955383
57
27
60
462478255
401477
57
246400
41
409843553
87
76
51
214825
442400
374228
35
112428
935074672
656890372
5
59
2690
383133
25
139498
402049
94
49...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 58682 lines

Test #13:

score: 0
Accepted
time: 32ms
memory: 13072kb

input:

324816
58
274655
4
345510
282462
49726
62
138034
8
32
27044
59
40
37
219889
156248
465249
163121
167770
8
33
136310
92626
9
392788
199287
55
2
83
756464077
446634
180236
27
107198
65
138423
93
63
358356
41
12
18
128618
372112
90
183993
34
90
235415
380735
390183313
37608
17094
26
41
711144953
30
10
...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 324816 lines

Test #14:

score: 0
Accepted
time: 31ms
memory: 13124kb

input:

310790
445525
497690839
357847
25471
75086
5
441583
189578
86
871161899
437140
161645
73
358297
74821
19
165603558
59051958
475161
84628
93
274415
95
916415212
495342
66
98987
90
86
41897
94
90
39
176048
479324
53
29
426943
10
407781
417286
74
480782
11149
35755631
36103
99
270796
361240
10
132451
9...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Y...

result:

ok 310790 lines

Test #15:

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

input:

62029
121545
951254815
65
35
6
8
634862839
208388
425838
52276
8
40
408898
39
12
75
96
667750842
303469
221428102
21
40
20
90
7
45
50102
139204
95
84
48
138593
432020
4
36
70
21
221075548
327998
124694
20455
2
550691681
989048440
416848
67
242009
146232
7977
442463
33746
8
375437
363491
9
431246
241...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 62029 lines

Test #16:

score: 0
Accepted
time: 28ms
memory: 13172kb

input:

318746
83
179063
244850
74483
278120
387372
311155
27522
422799
744609593
92
55
98
90687
363041
34
98
91
60
80
51
39
2
281489
489764
34
43
75
139325
51
28
184302585
32
3
7
237017
64
220429
38
78
356727
120138
4
140736
207921
408047
39
67380
19
256991
73
66896
13
436461
375694
30
199260
303135
90
89
...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 318746 lines

Test #17:

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

input:

142638
20845
8
50
95
46711
77
414717
43
65
266898
447625
66
474897
51
99
18
69
63823
35
1
6
22
7
231903
12
47
56
89
396255810
60
31
913634431
62
83
66804
17
16
77
19
89
72312
386238
82
1
123612
4
30177895
452400
7
56525
324757
37
85
210214698
53
99
27
34
32495
61560
329373
167395
6
48
25
12
70
22393...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Y...

result:

ok 142638 lines

Test #18:

score: 0
Accepted
time: 36ms
memory: 13172kb

input:

352360
289034
71550
257189
11
83
186461
97
418881
127588
289815
358721
159449
54
496146
326877
6
8
75
284239
5
46
349511
382463
100256
6
9
85
60
492231073
32
30
69
320791
243429
47
6
60
60
482854
53
82
34
896965521
301511
316577
141218
97
45
286322
203406
22
193355
475260
46
65307
35
389626
23
38122...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 352360 lines

Test #19:

score: 0
Accepted
time: 23ms
memory: 12940kb

input:

207785
1
10
16
4
170060
29
15
712319867
43
343787
184259
92
97
86
2
427106
37
14359
5
59
83
193310
94078
7
76
45
51
1
6
425865
4
147430
58
88
6
167642450
65
342136
21
166755
1
384257
49
212155
10
4
663322393
16
100637
26
453234251
1824
86
171945
391612
4
3334
180577599
37
64
51
13
315573870
291552
1...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 207785 lines

Test #20:

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

input:

91964
3
27
3
19
16
464045
33
73112
482832
48
55687
21548
8
478761
5
308192
386122
14
30
126780
5945
61
147794
174465
392632
1
415656
331676
100945
439981
254557
11349
460173
75
195355
5
66
21
264502416
419527
509898044
67
75
77
49
82
74
6
148777
445236048
82967
386317
331343978
461306
407077
7096583...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Y...

result:

ok 91964 lines

Test #21:

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

input:

92694
40
75
134125
25
29
449139
75
57
55
51
143239
96
463082
28
363539750
93
442887
40
139672
66
62
52105
73
169943
98
17
108396
155609
86
91
484013387
62
296286
45
93
81083
249213
78
62
382316
91
5
472036
89
29658
37
92
76
289999
45129
250066
54541
45
24
332187
166490
21
97
46
87
2926
215949
200531...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 92694 lines

Test #22:

score: 0
Accepted
time: 27ms
memory: 12976kb

input:

225347
39
259513
29
236828
230469
8
15
8
87
32
83
327973
51
58
235902
80450
80
428705
23
213349475
105753
246596
28667
417504
404651
25
48
489099
74
103184
11
205455
227030
62
19
209305
58
56
56
6
34
53
74583
138953
16501
494459
7
376391
445017494
41
197843
6
23
13342
91
194546
384584
338225
127326
...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 225347 lines

Test #23:

score: 0
Accepted
time: 23ms
memory: 13084kb

input:

211776
416325
144849
49
41000
175498
2
10
23
84619
741808499
99
596030366
279027
8
21
64112
36
796834281
196253
3
28
443267
107910
431679
26
43
39
94
410593
1
913442196
26
441261
4
107742
370964
192326
232045
11939
36
124698
207009
335235969
86794
14
31
131844318
76
26983
164655
678892134
7
6
91
618...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
N...

result:

ok 211776 lines

Test #24:

score: 0
Accepted
time: 45ms
memory: 13152kb

input:

386771
263524120
484993
170639
489763
69947
86
734726895
5
138564
271717
20520
237908
289160
60
41
72
4
15
8
36
281688
1
3
385975
309478
47
443721
95536
44
485705
261646
197616
351675
6
34010
6
347907
453464
74
39
49
327929
287388
14
2
2
65408740
313312
53
399640618
55629
86204
89
261160
607014827
1...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes...

result:

ok 386771 lines

Test #25:

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

input:

41762
444006
461000
238373
54
236784
39
18
398769
11
62919
1
42
31677
287825488
91
165270
168811
353118
9
493469
247750
61
144384001
178301
88
439750
588266186
184792
301372028
23
65
49907
17
53
204438
108198
208914
1
50
41
61271
481007
97
49
372104448
94426383
86
337033
426037
197942
49
458708
1
37...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Ye...

result:

ok 41762 lines

Test #26:

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

input:

189558
84
443356
75
173036
237449
89
51
87060
175239
78699
350797
96930
157608
83
342888
45
95
76222
70
48
417475
80
66
59
362945
174345
179206
2
143376147
81519
499896
4
2668028
73
83
98
67212
47913884
21
168007
8
69015
4
22
137332
135212
81714
114555
357028
80
328575
64
806776646
323491
56
37038
2...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 189558 lines

Test #27:

score: 0
Accepted
time: 45ms
memory: 13072kb

input:

402958
15
69167
155891
250120
140250
18376
92
89175
60
19716
113548
95
185524
52
74
485722998
109531
57
444636
25
308914
11
65
56
75
283514
22
1
2
6916
412616
66
704347273
120115768
48592
189137
169179992
326737
92
54
304297885
296106
80309
79
229837
90
46
170072
373462
135073
84
9
273614
973330337
...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 402958 lines

Test #28:

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

input:

194757
9
287995
83
933409067
89
61
348537902
5
214451
790870721
250470
88
179257
65686422
98
427765
7
258542
374838
249566
53
472673
499542
91
147218
476174
6
7
92
66
965418725
948300713
498822
72
5376
22952
2
400509
63
201300
348451
33
14
30364
94
87485249
385011
361262
173276526
16
45
40
493712282...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 194757 lines

Test #29:

score: 0
Accepted
time: 3ms
memory: 13200kb

input:

22788
65
30
7
68930
129895
94
4
66
83
239006451
68
73
83
56
60734
314550
230154
994976628
129113
9
602743720
153739
22000
96
373649
2
125478
74
150880156
473554
233205
33
29
97
6
945174923
89424
5
76
9
448194
55
75874
231725
57
289512
438006
9
345546
189173
59
72
483119577
459101
454056636
299943
62...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 22788 lines

Test #30:

score: 0
Accepted
time: 36ms
memory: 13064kb

input:

335584
107282
87
372764
39
95
67
450902
337856
3
7
47
42
20
61
49
8
232515
4
17
16
123460
27
62
93
95
15
41011
445989
13814
6
462381
62
414570
38
82
370325036
443374
97
389564
97
17
1
73
412629
389337
19
65
2
202489
44291827
68
77341
32
388597
16209
335814
30491
249122
10151
69
81
42
61
331755
3
28
...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Ye...

result:

ok 335584 lines

Test #31:

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

input:

76186
65990
5
322686
55
247035
1
6
50
67
16
11
7
495691
29
71
62
493306
26
7
96986
20
453666
53
201946
20544
677347793
196985936
206991
12
65
66
40
4
199862
491373
962278701
10
255956
16
362949
278275
305693
42
196505
347465
131991
88
13
500075817
225708802
948719701
453740
27
99
34
40
775076525
78
...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 76186 lines

Test #32:

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

input:

12733
356944
55
31
18
156326
1
217119
92
20
77
416525
20
16
444633
79
96
67670245
716399305
23
75
10
85
687268809
251741
24
4
45
80
10045
23
403673
87
110556
219500
81472
422593
85
884435004
30
94
479670
24
68
64
67
67
52539
335851
56
20
80
89
391638
93108
44
195840777
356627
10
360990
81
406777
5
4...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 12733 lines

Test #33:

score: 0
Accepted
time: 39ms
memory: 13192kb

input:

408191
7
12576
386631
380056
74
109526
464567
314108
81
16
52
410411
7
37984
9
267994
477129
215450
7
46
59
54
4
57
378553
254562
775414341
996669004
73
2
320328503
21069
265248
294257498
22
365467
89
187071
66118
36
75
295936
67
390282
19
360098
220924
76
378756
140880717
32
255097
5
69
459437
2307...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 408191 lines

Test #34:

score: 0
Accepted
time: 41ms
memory: 13048kb

input:

407714
401534
1
50
82
224072
84
495537882
224576
34
3640
17
28
26
378532
2
310075328
7
75
6
64
24
86
460045
3
5
327602030
45
54
209724
75
22
46707
300481
860481335
396246
32
927988739
170722
43
42134
68
6
43
32
173891267
334661
171099
208116
52
131527
20
395942
19
94675
391272
6
213256
49
2
346232
2...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Y...

result:

ok 407714 lines

Test #35:

score: 0
Accepted
time: 45ms
memory: 13136kb

input:

431495
61
460918363
24
92
596385112
423820
5
3
1
19
4
41
243955
204988
459250213
78
6
418063
65
21
63
248763
28
5
344267
307684
9
219146
3
19
399044
83
171270
1
608595111
116818982
518191020
356719
505994237
10351
14
402503513
30605
90125995
49
82
72
63
74
41
25
66
20
64
305131565
5
134616988
85
259...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Ye...

result:

ok 431495 lines

Test #36:

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

input:

35462
23
407455
1356
490638
5
409132
3716
33
218825
81
336319
624179546
15802588
349260
160060
120224
90
2
843272703
58
180896
289225
98
7
124056
94
764840121
33006
7372
370800
100690
392348
96
975012468
64
253628
96784
264868
34012
82
949023186
16
78095
25
53418
88493
71
90
94911
427387
823217142
4...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 35462 lines

Test #37:

score: 0
Accepted
time: 37ms
memory: 13216kb

input:

408716
194089
27
32
577283513
128213
565246925
236565138
89
80830
6
82
85
367726
56
447544
5
18
54
2
423598
26086622
67
10
155087
95
85422
811259094
42
57
300030
71
117529
34
386420
26992768
8
78
231421
69
80
90
80
407275950
136735
249837
489730
39
796030951
65
381932
7
15
8
71325935
520414774
72818...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 408716 lines

Test #38:

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

input:

101074
433040263
10
2
462635
77572862
97
50
367808543
62414
199200
448019
583845660
2
162616
98
113438
93
14
55
21
15
7
3
2
120818
290946
42
433643
41347
361864
156751
323784
58
41
24
966024297
76
68503
109379
260842
325202
4
50
7
97
486124
88
235191
277511
38012
1
414773
234518
706278262
227796
199...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Ye...

result:

ok 101074 lines

Test #39:

score: 0
Accepted
time: 48ms
memory: 12024kb

input:

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

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 500000 lines