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

243
49938
0 2 -6
0 3 2355
0 4 3503
0 6 -4
0 8 1437
0 9 1231
0 10 -7
0 11 3758
0 12 9407
0 13 4944
0 15 4029
0 17 10222
0 19 3806
0 20 -9
0 21 9361
0 22 5353
0 23 -7
0 24 3104
0 25 5872
0 26 3961
0 27 3122
0 28 -7
0 29 5819
0 30 4542
0 31 5290
0 32 2411
0 33 2045
0 34 9376
0 35 10256
0 36 3017
0 37 6212
0 38 8548
0 39 1845
0 40 10021
0 43 10150
0 44 6503
0 45 9198
0 46 -6
0 47 3563
0 48 7562
0 50 6232
0 51 2605
0 52 1013
0 53 3377
0 54 -6
0 56 1371
0 58 7755
0 59 8192
0 60 3277
0 61 4959
0 62 4852
0 63 4184
0 64 -5
0 65 -2
0 66 1546
0 67 2376
0 68 1734
0 69 8850
0 70 7105
0 71 -8
0 72 6770
0 73 3571
0 74 -2
0 75 9850
0 76 1500
0 78 6350
0 79 5296
0 80 1616
0 81 2617
0 82 2577
0 83 4478
0 84 1609
0 85 9876
0 86 4032
0 87 2759
0 88 5012
0 89 2188
0 90 4337
0 92 9523
0 93 1220
0 96 8706
0 97 3210
0 98 1830
0 99 9665
0 100 8356
0 101 5975
0 102 2431
0 103 10304
0 104 4729
0 105 4452
0 106 -3
0 107 3806
0 108 4591
0 109 1138
0 110 5355
0 111 -1
0 112 4495
0 113 4845
0 114 3032
0 115 1021
0 116 5340
0 117 3961
0 118

JOJ Answer

-12
-149
874
-184
830
910
810
921
-80
824
845
837
1334
-176
922
999
1004
1720
916
1515
927
995
855
1183
-61
-93
790
-104
848
911
783
1208
891
991
-17
846
-143
781
-65
-164
840
-174
-116
802
1054
790
-45
826
824
828
1079
872
-22
949
-40
-76
872
794
982
842
772
-14
792
-27
-91
-16
-171
-82
872
938
-42
1114
-10
1906
837
788
-151
-26
917
-58
859
892
905
796
-34
871
-185
771
848
-171
816
993
997
-35
-129
-226
-162
1216
994
-142
884
871
804
963
841
820
-114
904
-27
-97
843
889
-34
1065
784
819
-35
989
1156
922
-136
928
922
831
789
925
-165
-151
-180
859
-13
887
858
907
936
933
916
834
868
-122
-13
-75
-98
899
-69
813
-11
818
781
804
843
-45
-7
791
-42
-15
786
817
-26
1086
-170
817
1095
-164
888
791
883
784
-164
811
-106
987
876
1001
892
-25
-20
930
-21
956
917
808
933
-28
-20
-60
792
902
-20
-41
860
-82
926
1054
865
-34
-152
-9
-33
865
-35
835
872
851
821
959
-200
-99
908
-163
1089
959
815
854
1005
-49
880
-100
835
-38
-93
-109
1149
802
796
941
-143
779
928
828
816
-151
-68
917
778
-174
894
-94
895
780
780
-59
885