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

2788
4138
4276
10052
5997
8303
6807
INF
5197
INF
4375
2588
3245
3367
7991
-6
-3
3319
8460
3856
1651
INF
9222
INF
10408
5072
10384
INF
4804
INF
2635
5702
4402
1989
1392
4743
4415
INF
9595
7824
1478
9976
4444
4399
5238
3834
1739
7969
3583
INF
7518
6359
5859
4682
-8
6123
4029
INF
9276
6001
8161
7100
INF
1167
-3
8907
8388
4221
9558
3483
5739
5975
6260
3904
3121
8725
9707
INF
1214
7329
1276
1054
INF
-1
1137
INF
9718
6863
2835
-2
INF
2202
2573
4924
5852
4991
4430
INF
2112
INF
8725
2810
10179
2866
7388
9563
8887
8465
9718
8018
INF
7511
-9
3306
6377
3329
8978
5751
7330
10080
8384
7488
9900
8585
1761
INF
6218
2629
4181
3507
4589
9569
INF
10350
2208
INF
INF
8500
7818
9029
1726
INF
3183
3736
7567
INF
5537
3830
INF
6492
INF
5859
INF
6416
2673
7181
9313
6743
-2
5546
INF
4023
4963
INF
3346
9097
2324
6664
2166
7175
2791
7316
1918
4947
7866
8277
1863
7861
3371
2391
6347
6589
-10
INF
INF
INF
9212
10435
8305
4294
INF
4321
9260
8322
5123
3240
9455
1552
1279
5018
5290
2865
1322
7699
INF
5553
3072
6202
4407
INF
1504
-1
7458
5976

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