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, the main problem you meet now is Time Exceeded. And the exit code of your program is -9, which should be 0.

Please double check your code to solve this problem and try again.

Your Answer

-106
-46
-102
-84
1034
982
-66
1044
1000
982
-12
1509
996
971
2074
-13
-42
1346
979
1037
1082
-14
-116
991
1688
981
-23
1944
1074
2060
-47
1189
982
-9
1029
1013
-103
1118
-56
-96
1029
-100
1018
1017
960
1091
-63
-93
-115
967
1701
-43
-24
-27
-8
1053
1209
-23
-24
-94
1004
2049
936
-95
-50
-14
-30
968
1005
954
1089
-114
909
-60
1231
1020
1246
977
1008
-11
993
1054
-84
-46
975
984
-162
970
-30
-44
1644
-70
1739
-44
939
917
-61
1506
-77
1044
1020
1481
980
965
1191
1427
978
-33
-50
973
1002
-137
-15
963
-64
-44
1028
936
950
1048
1033
1047
1722
-65
1042
960
-24
926
994
1003
918
980
965
907
-79
1039
1144
-83
1004
952
-24
-25
968
-42
1095
1020
1050
1079
980
-14
-12
-63
2110
-51
-22
1025
968
-97
-94
1662
-51
1011
1721
995
-152
-25
932
1217
1247
-24
1807
-38
1335
1000
997
-88
1059
1039
1078
958
-15
-72
-107
1253
-48
981
995
1061
-48
991
972
-83
1186
-101
1101
1727
1065
-30
1074
928
-85
-88
1060
-36
968
971
1003
1360
-14
994
1020
-89
1152
-69
943
1132
-59
-64
1036
-93
942
-39
959
1071
1265
-33
-16
-81
-104
1268
-8
967
9

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