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, the main problem you meet now is Time Exceeded. And the exit code of your program is -9, which should be 0.

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

Your Answer

0 1 4227
0 3 4179
0 4 4425
0 5 8514
0 8 1062
0 9 9170
0 11 3441
0 12 7479
0 13 8804
0 14 4849
0 15 7938
0 17 10477
0 18 -8
0 19 9455
0 20 9653
0 23 4698
0 24 2149
0 25 9441
0 26 8275
0 29 2228
0 30 2101
0 31 2318
0 33 8821
0 34 2508
0 36 7752
0 37 2555
0 38 3729
0 41 2007
0 42 8707
0 43 9961
0 44 3327
0 48 6399
0 49 1446
0 51 10292
0 54 8762
0 56 1083
0 57 8387
0 58 3691
0 59 10068
0 60 1421
0 61 4654
0 62 2063
0 64 7100
0 65 1267
0 67 4119
0 68 9157
0 69 4703
0 71 1312
0 72 8422
0 73 8438
0 79 7603
0 80 4152
0 83 4300
0 84 3024
0 86 4204
0 87 4425
0 88 10449
0 89 3582
0 90 5099
0 92 3868
0 93 2809
0 94 5734
0 95 4899
0 97 8178
0 98 4812
0 99 -5
0 100 -10
0 101 10111
0 102 5777
0 104 5164
0 105 6982
0 107 5251
0 108 7160
0 109 4257
0 112 5245
0 113 7116
0 115 6755
0 116 1135
0 118 6322
0 121 2292
0 122 3099
0 123 3768
0 125 6861
0 127 4795
0 128 2898
0 129 2908
0 130 8629
0 131 9921
0 132 6336
0 133 1468
0 134 1884
0 135 1860
0 137 1726
0 138 5386
0 139 10462
0 140 9006
0 144 7096
0 146 6873
0 147 4707
0 151 

JOJ Answer

1033
1128
973
936
987
1073
958
1079
1074
-21
-41
886
-72
937
914
-67
912
1073
938
-15
-27
913
989
929
941
-33
952
-84
1454
-19
1068
-84
983
910
983
1134
906
902
930
1132
947
1500
934
1070
899
-17
1114
1266
935
943
1727
1345
2113
1040
1308
992
988
950
1120
-70
1725
-21
2067
-33
1008
1286
-36
1402
2161
974
-51
-23
929
935
2047
1617
-26
933
959
-22
961
2345
967
938
971
-79
1392
2013
-29
1136
2240
1077
1091
-9
1241
-19
1256
2207
1348
1354
1035
925
947
958
-6
-18
1532
1308
1095
1029
1380
907
1289
1063
-32
-47
-23
1161
-14
1402
898
2101
-30
933
-60
968
-32
891
914
-42
939
-2
2226
1001
-37
-35
1438
1199
-45
-48
959
979
962
1863
1721
943
-33
1236
1217
1030
-27
-2
1135
-19
1106
1146
933
903
996
1073
949
-7
1162
1002
1721
-34
994
-87
-25
986
1016
-49
1291
1033
1425
1026
1766
1065
973
905
1002
912
1054
1054
1156
982
967
1057
967
1062
920
1052
905
914
1523
912
-21
1114
918
969
2079
927
904
1461
-23
932
901
924
926
1299
977
1002
-72
-26
1731
901
2588
991
1018
921
1145
1049
1094
1541
-32
-3
908
2016
2088
940
933
-33
1482
-