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

4087
1206
2272
3630
2070
1082
1496
2187
2185
1046
1086
-9
1805
2852
-7
2415
2120
2203
3666
4367
2395
3079
2445
2058
1610
4558
1383
1391
2986
1447
2675
2099
2098
5274
2619
2652
1296
2553
1362
2423
1073
1042
3339
1045
4956
3534
1092
1969
2088
1009
2013
1012
1111
1084
2094
1501
2245
-2
2403
1082
2298
1861
1269
2175
1143
1474
2238
2796
1846
2046
1134
2261
2405
1208
2459
994
2598
1256
1036
1229
2852
2536
2534
1436
3420
2312
1116
2800
1004
1732
1302
4439
1301
1782
1113
2244
3117
2351
2706
3471
1951
3110
1623
2279
2342
1486
2371
2164
-7
1830
2381
1110
2271
3346
2038
1542
1109
1741
2075
3457
1142
3736
1538
1164
2183
1359
1004
2037
-3
3669
2742
2090
2262
1497
5682
2196
2017
2200
-3
4364
1001
4021
1589
2364
1064
2191
1538
2334
2187
2220
2150
3217
2586
3398
2240
2379
1709
2616
3072
1359
1026
2021
2727
4040
2545
2530
3391
2235
3166
1695
2533
3424
1245
1246
1104
1137
1568
2091
3592
4121
3485
1530
2106
1092
3196
1381
2236
2234
2397
2289
2908
996
1481
2711
3129
3508
2217
2279
1004
5993
3597
1049
1115
3993
1337
1702
3115
336

JOJ Answer

-117
784
-23
-177
798
-121
-46
749
811
824
833
-9
772
1094
-88
839
-80
863
-142
-209
-143
-31
-33
875
-81
-214
-19
843
-19
842
779
925
1358
904
-16
-54
765
803
-49
839
1073
-93
847
956
-18
-129
-56
-45
-102
852
-58
-95
-11
928
2009
913
927
-42
-140
825
934
897
763
-92
-66
858
750
966
-13
818
-38
801
912
896
-104
821
807
-57
750
843
-19
-100
-70
848
-73
-10
-57
796
813
761
871
-54
800
801
-16
783
925
-129
821
-43
-81
916
-18
897
1024
919
-13
-28
-160
1003
986
756
808
-65
898
1542
959
-45
750
946
-27
-53
840
884
-66
889
-22
-71
-60
-38
852
837
912
833
-136
-38
-99
-78
-89
-153
972
-78
-64
923
-102
814
837
776
895
-18
763
-95
-19
886
766
773
-97
993
-128
804
794
-65
-112
836
-170
803
-215
811
950
-139
776
-88
798
1246
804
-96
788
795
-85
-198
-78
823
-164
1092
-103
805
984
989
-128
749
-31
756
782
864
-65
750
910
909
859
-114
1011
-76
796
936
923
-91
-43
862
-12
806
-78
780
969
837
824
786
916
924
-79
769
1170
856
1071
-49
-37
873
827
-43
1942
-120
932
-161
980
-72
854
796
-172
-14
852
-83
1476
-100
831
922
-25