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

19 275
0 1 935
0 2 1691
0 3 5588
0 5 1440
0 6 4621
0 7 304
0 8 1906
0 10 3445
0 11 2774
0 12 4445
0 14 3504
0 16 1076
0 17 7944
0 18 -471
1 0 6793
1 2 7730
1 3 349
1 5 149
1 6 7261
1 7 4464
1 8 6551
1 9 1375
1 10 7607
1 12 3337
1 13 1751
1 14 7949
1 15 1638
1 16 662
1 17 8616
1 18 1883
2 0 5080
2 1 2265
2 4 3438
2 6 5016
2 7 540
2 10 2529
2 11 1301
2 12 3116
2 13 3837
2 14 1055
2 15 8804
2 16 8997
2 17 1665
2 18 5786
3 0 8176
3 1 2369
3 2 234
3 5 7989
3 6 6684
3 7 5225
3 9 7017
3 10 8444
3 11 8540
3 12 3641
3 13 6473
3 14 423
3 15 5452
3 16 4181
3 17 2465
4 0 597
4 2 2084
4 3 2280
4 5 4649
4 6 4250
4 7 1480
4 8 8702
4 9 812
4 10 6435
4 11 3808
4 12 4960
4 14 5967
4 15 5677
4 17 2468
4 18 2657
5 0 3117
5 1 4924
5 2 8800
5 6 6135
5 7 3954
5 9 862
5 10 1606
5 12 5533
5 13 3964
5 14 1916
5 15 3147
5 17 8130
5 18 335
6 0 4993
6 1 1299
6 2 7151
6 3 2891
6 5 8468
6 7 7779
6 10 1824
6 11 672
6 12 4419
6 15 7631
6 16 7555
6 17 242
7 0 2737
7 1 825
7 2 8474
7 3 2576
7 4 157
7 5 8846
7 6 1075
7 9 3852
7 10 925
7 13 1396

JOJ Answer

925
-247
499
1707
537
1055
1351
843
1009
801
1116
1535
542
578
597
619
1622
970
216
1311
149
305
1515
1806
564
-258
1685
483
540
1505
789
540
151
-374
-342
1229
1469
1548
1323
2261
122
1505
470
843
1172
356
-127
1599
1322
114
683
1109
233
-152
-120
1244
1229
1009
1535
470
1055
-195
1505
1449
441
1948
801
181
-279
-84
323
1047
1806
1400
-12
1400
817
596
107
149
320
352
342
1189
619
222
760
-471
323
334
414
-127
970
499
697
-342
542
697
1065
-342
-84
520
1034
378
118
1609
151
356
619
1260
537
169
743
564
1707
754
520
940
542
1244
344
-245
1322
1422
121
31
157
5
251
1299
931
789
1707
817
1016
-258
119
1010
828
286
563
679
754
200
119
564
910
238
226
-207
1311
754
1229
520
2065
373
1604
0
349
1448
746
579
151
122
1073
-364
470
760
854
342
323
2062
1548
470
470
597
235
-91
2027
226
1015
442
-163
2198
521
1274
1299
1465
743
151
-91
2304
1550
578
-163
342
356
149
242
233
378
1465
970
1274
591
984
1914
1536
442
970
1311
1203
1010
373
562
830
789
107
1301
1536
1015
-175
373
0
-207
828
1297
579
356
31
356
672
1322
1274