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

52
337
45
0
293
435
0
813
88
0
293
101
167
1109
0
249
0
255
1021
1358
0
685
88
293
0
190
337
990
13
698
0
45
257
407
220
1817
190
846
81
618
758
1301
337
988
13
858
0
603
337
435
244
0
220
249
20
990
694
17
1057
387
721
45
0
769
146
13
52
1949
86
354
45
514
17
293
538
0
17
88
108
0
1199
68
780
42
232
354
0
220
43
244
52
108
303
23
306
0
306
1020
0
448
803
167
696
0
945
0
605
1314
101
1580
0
0
412
220
337
354
167
1656
348
255
1109
88
377
538
0
1270
167
131
0
771
218
0
685
161
173
1324
780
1358
480
146
153
88
681
780
1109
306
0
405
293
244
1318
1021
173
234
1022
306
108
88
1698
118
0
661
303
694
23
685
2337
681
20
435
73
681
42
435
33
132
0
0
90
0
0
497
61
681
0
739
169
167
20
78
1021
647
73
220
45
160
605
853
1181
0
555
13
780
278
351
146
37
160
257
278
86
101
1656
88
42
220
86
0
73
0
303
845
73
698
0
1656
0
857
306
1832
132

JOJ Answer

-10
181
45
-57
205
349
5
909
175
4
292
229
-48
1324
-6
319
10
169
1084
1358
-17
801
154
172
-57
308
213
1173
-25
698
-83
45
375
340
275
1817
276
846
205
551
750
1301
280
988
-80
1041
-120
692
219
378
244
-17
274
343
47
1173
607
104
1240
379
845
260
-37
777
361
-40
-10
2011
-22
373
112
514
135
292
452
-120
167
111
-18
-37
1382
192
867
-114
232
405
-17
328
-19
244
-10
81
185
-68
281
-183
301
1195
-116
332
927
110
759
61
1101
-67
519
1376
229
1763
5
-65
288
212
280
344
110
1772
348
171
1259
152
434
420
-64
1426
-48
139
24
779
218
-116
801
45
106
1324
867
1358
480
232
210
154
595
864
1324
212
24
405
292
311
1318
1108
106
234
1022
252
41
88
1698
126
5
577
179
607
85
801
2337
618
-111
373
-102
498
-173
252
1
132
-32
-215
98
-51
6
435
128
466
93
739
226
-48
-46
162
1088
642
18
279
108
74
455
861
1181
88
555
9
896
493
413
232
121
76
257
493
7
184
1719
240
-20
279
27
30
24
55
219
1028
-69
761
24
1656
-65
857
252
1832
132