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

1276
1847
1720
1026
2122
2641
1671
1061
3130
2854
2119
2383
3150
1377
3812
-6
-3
2354
1163
1037
1651
2087
1746
1018
2125
2159
1543
1944
2189
2522
2290
1218
1833
1989
1392
2480
1001
1674
1685
1108
1478
1088
1663
2150
1018
1815
1099
2293
2172
2407
3141
1140
2282
1085
-8
2360
1419
1272
2115
1094
1171
2388
1398
1167
-3
2451
1756
2097
2309
1865
2371
1648
2705
1554
1304
2412
2887
2067
1056
1690
1276
1054
1154
-1
1137
1315
2136
2116
2195
-2
2917
1121
2573
1740
2310
1652
1515
2619
2043
2086
2412
2447
1040
2283
2399
2506
1209
1043
1884
2134
1275
1011
-9
2314
2226
2235
2001
2425
1121
2556
2068
2569
2801
1249
1761
1430
1339
1345
2135
2445
1033
2441
1256
1038
1541
1448
2412
1154
2983
1585
1383
1689
2166
2172
2769
2117
2349
2125
3277
2270
1006
2104
2233
1051
1102
2210
1584
2608
-2
2384
2065
3201
2182
2072
1705
1610
2322
1340
2166
1032
2306
2350
1918
2455
2128
1616
1863
1099
1131
2172
1700
1601
-10
2210
2370
1769
2151
1321
1828
1555
1509
2226
2073
1534
1701
2393
1384
1552
1088
2714
2128
1065
1322
2529
2623
2413
2485
2573
3

JOJ Answer

-106
-86
-102
-105
1028
864
-84
865
853
982
-12
1431
996
908
1135
-13
-42
1066
897
939
945
-14
-136
877
1060
915
-29
1930
862
2060
-49
918
920
-9
1012
933
-117
899
-56
-119
864
-120
864
964
887
889
-94
-116
-136
956
1701
-51
-24
-27
-8
941
968
-25
-24
-118
936
2049
877
-98
-50
-14
-30
871
997
868
1089
-124
894
-60
944
968
928
888
1001
-11
878
856
-106
-55
940
883
-171
924
-38
-75
1644
-70
1739
-55
852
876
-70
1155
-91
1044
968
955
929
955
1183
1427
958
-33
-65
859
891
-153
-15
927
-73
-44
860
861
940
1048
885
903
1722
-65
904
880
-24
911
958
939
909
945
955
903
-80
906
985
-93
1004
858
-41
-25
968
-43
1095
908
901
942
976
-38
-12
-72
1930
-97
-22
880
901
-111
-103
1045
-56
917
1689
990
-162
-41
922
953
1026
-24
1807
-38
1335
948
997
-91
1059
844
909
941
-15
-114
-118
1029
-81
975
867
855
-48
876
906
-94
1052
-129
969
1727
1065
-43
981
885
-90
-118
1008
-36
937
876
987
1360
-14
896
1020
-89
936
-82
884
928
-68
-64
984
-106
942
-42
953
860
1265
-33
-16
-152
-120
891
-8
930
890
838
1947
854
1052
908
2129
-23
996