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

-12
-102
886
-139
INF
929
859
948
INF
871
INF
898
1334
-140
960
999
1033
1720
974
1515
949
INF
INF
INF
-29
-93
849
-76
875
INF
838
1317
907
991
-17
885
-116
816
-53
-141
887
-143
-71
863
1066
854
-42
862
INF
903
1079
932
-22
INF
-39
-52
901
822
1001
874
867
INF
847
-18
-60
-16
-134
-82
888
INF
-42
1142
-10
INF
873
838
-128
-26
1008
-58
INF
952
917
872
-34
912
-171
834
893
-170
861
993
997
-22
-70
-138
-149
INF
994
-59
899
913
816
1002
857
843
-114
954
805
-62
865
927
-34
1065
803
860
-35
1088
INF
948
INF
989
951
856
INF
933
-125
-125
-127
929
-13
INF
899
932
955
INF
INF
873
883
-65
-13
-75
INF
929
INF
830
-11
859
806
INF
869
-45
-7
INF
-33
-15
853
867
-26
1086
-151
INF
1095
-116
INF
INF
895
881
-141
823
-70
INF
891
1079
921
-25
-20
942
-21
995
921
867
INF
810
-20
-60
843
944
INF
-23
INF
-65
INF
1054
928
-5
-122
INF
-33
910
-35
868
934
888
881
965
INF
-67
935
INF
1089
976
INF
879
1005
-42
891
-74
INF
INF
INF
-83
1204
844
853
945
-126
876
928
850
862
-109
-58
966
845
-128
915
INF
895
849
INF
INF
927
987
873
INF

JOJ Answer

-12
-149
874
-184
830
910
810
921
-80
824
845
837
1334
-176
922
999
1004
1720
916
1515
927
995
855
1183
-61
-93
790
-104
848
911
783
1208
891
991
-17
846
-143
781
-65
-164
840
-174
-116
802
1054
790
-45
826
824
828
1079
872
-22
949
-40
-76
872
794
982
842
772
-14
792
-27
-91
-16
-171
-82
872
938
-42
1114
-10
1906
837
788
-151
-26
917
-58
859
892
905
796
-34
871
-185
771
848
-171
816
993
997
-35
-129
-226
-162
1216
994
-142
884
871
804
963
841
820
-114
904
-27
-97
843
889
-34
1065
784
819
-35
989
1156
922
-136
928
922
831
789
925
-165
-151
-180
859
-13
887
858
907
936
933
916
834
868
-122
-13
-75
-98
899
-69
813
-11
818
781
804
843
-45
-7
791
-42
-15
786
817
-26
1086
-170
817
1095
-164
888
791
883
784
-164
811
-106
987
876
1001
892
-25
-20
930
-21
956
917
808
933
-28
-20
-60
792
902
-20
-41
860
-82
926
1054
865
-34
-152
-9
-33
865
-35
835
872
851
821
959
-200
-99
908
-163
1089
959
815
854
1005
-49
880
-100
835
-38
-93
-109
1149
802
796
941
-143
779
928
828
816
-151
-68
917
778
-174
894
-94
895
780
780
-59
885