Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr


        

Hints

Your answer may be identical to the JOJ answer in the first several lines.

However, you will still get Wrong Answer because the complete output may be longer and there might be errors in the future lines.

Please double check your code to solve this problem and try again.

Your Answer

5240 0
187
11 20
109
39 26
369
21 39
385
10 24
626
47 36
108
2 8
5
29 7
3
42 12
279
17 10
606
5 14
266
42 6
467
43 16
774
43 39
370
10 49
-12
31 41
130
45 12
585
40 18
312
32 42
36
22 29
464
8 5
288
37 45
308
23 47
526
10 21
60
15 31
344
48 39
192
51 6
208
27 25
775
43 30
316
30 40
-10
51 1
106
31 16
414
22 40
75
27 25
775
38 37
492
32 7
229
0 35
347
36 10
465
47 32
117
20 12
271
45 7
302
23 15
372
29 44
788
7 29
794
32 6
192
34 22
1034
50 21
321
45 40
399
5 50
248
28 46
37
50 0
400
40 16
468
23 19
529
28 35
151
30 38
126
41 0
380
34 30
6
2 50
22
20 14
29
27 50
355
23 41
372
40 10
524
38 10
825
35 8
472
50 6
418
11 18
298
43 28
423
33 25
358
36 17
1129
30 27
109
32 0
170
22 11
140
20 29
365
32 13
412
48 20
159
34 14
35
38 48
735
49 2
306
50 44
1199
36 27
111
25 21
176
47 41
61
40 39
64
35 13
394
29 36
108
6 37
567
0 29
716
5 33
235
45 7
302
13 5
1496
16 51
1262
45 23
435
28 27
151
31 23
87
4 25
700
49 39
352
44 39
495
18 6
141
10 0
61
12 9
202
15 21
67
37 12
464
34 26
329
12 24
626
14 17
1101
33 35
-2
37 47
5

JOJ Answer

187
109
369
385
626
108
5
3
279
606
266
467
774
370
-12
130
585
312
36
464
288
308
526
60
344
192
208
775
316
-10
106
414
75
775
492
229
347
465
117
271
302
372
788
794
192
1034
321
399
248
37
400
468
529
151
126
380
6
22
29
355
372
524
825
472
418
298
423
358
1129
109
170
140
365
412
159
35
735
306
1199
111
176
61
64
394
108
567
716
235
302
1496
1262
435
151
87
700
352
495
141
61
202
67
464
329
626
1101
-2
531
-8
665
115
327
1291
38
108
479
139
550
316
563
477
333
23
288
407
316
233
-5
351
1104
1441
35
564
81
3
288
1628
152
85
186
79
59
863
173
1248
373
206
1272
571
569
45
-6
85
384
225
494
1174
173
145
-8
134
174
132
124
462
471
-8
567
-2
463
55
1029
469
417
100
69
61
540
232
1358
320
305
61
48
87
46
328
454
411
278
427
137
543
459
498
206
170
469
148
166
624
308
419
1075
135
106
57
342
172
66
352
238
233
-4
41
384
1131
111
406
329
263
342
17
-8
217
982
345
-1
615
471
1358
145
305
823
409
205
43
906
369
552
375
215
260
239
144
296
348
192
70
178
164
549
406
361
243
-3
233
230
312
0
251
73
520
478
802
118
74