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

2673
3280
1938
3501
2708
2056
1075
2472
1279
3793
1420
1615
2210
1250
1103
2079
2195
2351
1105
2187
2213
2324
1013
2538
2891
1846
2470
2363
2674
3730
1698
3405
1711
2161
999
2508
1052
1584
3901
2393
2201
3355
4587
1624
1810
2304
2442
2344
2427
2464
2717
2264
-3
2579
2699
1360
1040
1188
2974
998
1717
1081
1276
1313
2005
2236
1312
3218
2302
2415
-5
3954
1024
3494
2392
1377
2325
-3
2391
2849
2557
1645
1371
1183
1183
2229
2212
2583
2533
1575
2382
2179
1204
1895
2230
2764
6521
1874
2300
2118
1151
1010
1007
3272
1111
1329
1335
2136
2380
2731
1875
1211
3475
2141
4754
2428
3593
1135
2991
2643
2295
1509
1389
2906
1917
1372
1883
5250
3336
1569
1215
2125
1803
2698
4785
3585
1139
1546
2661
1219
1277
2198
2063
2136
2166
1185
2349
1886
1490
1805
1627
8001
-7
2106
2719
2236
1239
2303
1146
2369
2378
3360
1095
5134
1480
2069
2469
2426
2393
2290
1593
2493
2042
1565
1041
2560
2132
1363
1339
3290
2795
3635
3156
1464
1148
2305
2225
2032
1179
1145
1555
2834
1136
1809
1094
-5
2149
1079
1258
1577
-2
1879
4888
2838
4374
1210
5228
197

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