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

4558
2446
2297
1026
3371
2806
1883
1061
3130
2854
2119
2389
4156
1377
3957
-6
-3
2473
1163
1037
1651
2087
1746
1018
2125
2355
1543
1944
2189
2522
2412
1218
1871
2256
1392
3312
2307
2559
2734
2518
2435
3515
2445
2532
1018
1887
1099
2293
2317
2407
3233
1140
2301
1085
-8
2360
1419
1272
2115
4959
1171
2388
1398
1334
-3
2452
2116
2275
2309
2056
2536
1970
2705
2382
1304
2412
3204
2302
1056
1690
1276
1054
1567
-1
1137
2133
4010
2180
3301
-2
3491
3752
2573
2390
2310
2380
1515
2619
2112
2086
2412
2447
1040
2283
2399
2506
1209
1043
1884
2134
1275
1011
-9
2314
2503
3303
2285
3282
1121
3601
2068
3247
2801
4417
2947
1430
1339
2070
2423
2559
1033
3046
1256
1038
2472
2020
2412
2256
5578
2284
1482
1689
2166
2172
2899
2250
2349
2420
3277
2270
2222
3008
2233
1051
1102
2210
1584
3826
2256
2384
2065
3201
2182
2072
1751
3800
2322
2963
2166
1032
2545
3741
1918
2455
2128
3249
1863
1099
2419
2279
1700
3738
-10
2210
2370
2289
3001
1321
2309
2149
1509
2226
2073
2322
1701
2393
1384
2902
1088
3265
2128
1065
2307
4516
3028
2413
2485
2573

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