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

1303
205
555
1217
417
704
1651
1280
489
862
292
236
1172
1476
1281
905
1142
825
1935
1547
821
866
448
884
1217
1285
694
1973
1032
1309
572
364
832
1079
2107
2020
276
919
1130
784
1505
1499
862
1053
1066
1716
1135
1001
723
1178
484
821
274
1098
740
1973
1064
415
1611
879
1084
918
780
1400
476
1200
1303
2723
624
833
1528
514
916
292
1038
1135
1144
908
483
780
1382
1448
1300
319
777
1186
821
1397
1546
484
1303
661
577
1077
282
558
301
2451
1126
444
1385
994
1427
1130
1424
419
1207
1789
236
2237
1651
1482
288
531
862
344
994
2273
973
465
1553
1837
1215
651
627
1966
1172
1130
624
1490
692
1126
866
723
465
1569
1300
1547
1230
714
480
448
1777
864
1476
902
624
1083
292
768
1681
1541
465
467
1046
898
410
760
2261
1410
1824
577
548
1064
1341
866
3320
618
1034
1567
610
1506
862
433
789
132
60
700
724
1246
1151
1612
1235
1611
1070
1402
496
1172
622
1138
1277
967
18
1312
1537
1141
653
1712
1507
1252
864
9
1141
733
1103
714
732
1035
257
733
464
498
2929
240
1409
2098
27
705
888
55
799
1559
554
1576
624
2217
1190
1502
898

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