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

-106
-42
-102
-28
1034
899
-34
INF
900
INF
-12
1431
996
971
1977
-13
-42
1066
919
1010
971
INF
-116
INF
1060
924
-23
INF
951
INF
-47
926
929
-9
1012
937
-82
INF
-56
-96
880
-99
894
970
898
899
-63
-93
-115
INF
1701
-27
859
-27
-8
1000
1047
INF
-24
-94
972
2049
INF
-95
-50
-14
850
881
1005
871
1089
-114
894
-60
950
1020
938
INF
1008
-11
959
882
INF
-9
940
INF
-131
1028
-30
-44
INF
-70
1739
-44
895
905
-61
INF
-77
INF
1020
1002
953
965
1191
1427
978
-33
-50
877
INF
-137
-15
951
821
-44
870
883
1011
1048
895
913
1722
-65
914
INF
-24
926
994
954
910
987
INF
907
-79
INF
INF
-74
1007
885
-24
INF
1033
-42
1095
INF
911
942
INF
-14
INF
-63
INF
-51
-22
932
922
-94
-94
1045
INF
927
1721
INF
-138
-25
932
980
1247
-24
1807
-38
1335
957
997
-88
1059
854
927
958
859
-72
-107
INF
INF
INF
871
878
-48
880
INF
-83
1107
-95
977
1727
1074
-25
1068
928
-85
-88
1008
-36
INF
892
995
1360
-14
INF
1020
-89
1001
-69
931
975
-59
-64
992
-93
INF
-39
959
890
1265
856
-16
-81
-104
901
-8
INF
INF
889
1967
901
1064
923
INF
INF
1006
INF
1130

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