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

1856
2461
5618
4699
10576
2104
7607
5324
10919
19070
2007
2629
13612
2450
2351
5045
9256
33165
5739
4828
11675
20662
6632
5780
7245
6655
20086
5579
8424
16562
10236
3479
3604
1793
5695
9619
4654
13926
2801
1877
8453
1500
2476
8458
28112
15153
7162
12159
3568
3855
3878
3194
4481
4895
1758
4984
4861
2554
3993
4970
7375
11412
4413
13683
4164
7807
2919
12352
9434
5998
8930
3518
3284
8876
13065
17389
6134
4425
4979
3739
8869
5245
11746
9992
1082
4719
18634
4726
5057
7976
2569
2993
4563
-9
2524
7883
7169
9611
1457
18172
23666
8147
11446
1630
-6
5682
16010
19165
3898
11345
16013
4915
5539
2317
7691
9456
4101
9554
7540
12352
17988
9632
2021
8221
5352
3422
6797
13116
9483
7616
8006
15931
6579
11248
8035
16116
11149
3476
1365
2013
16355
5324
10036
17716
1721
12586
10194
6628
2275
4734
2510
-2
6909
16798
16066
4151
28643
8788
3998
11548
11211
6623
26111
9259
4735
6994
7773
21308
5141
7993
8001
4560
6334
19120
15942
2526
15310
1322
4041
9561
6059
7371
20897
18709
8993
10626
4704
6190
3099
7782
7524
2865
1527
3843
2178
22

JOJ Answer

1033
1128
973
936
987
1073
958
1079
1074
-21
-41
886
-72
937
914
-67
912
1073
938
-15
-27
913
989
929
941
-33
952
-84
1454
-19
1068
-84
983
910
983
1134
906
902
930
1132
947
1500
934
1070
899
-17
1114
1266
935
943
1727
1345
2113
1040
1308
992
988
950
1120
-70
1725
-21
2067
-33
1008
1286
-36
1402
2161
974
-51
-23
929
935
2047
1617
-26
933
959
-22
961
2345
967
938
971
-79
1392
2013
-29
1136
2240
1077
1091
-9
1241
-19
1256
2207
1348
1354
1035
925
947
958
-6
-18
1532
1308
1095
1029
1380
907
1289
1063
-32
-47
-23
1161
-14
1402
898
2101
-30
933
-60
968
-32
891
914
-42
939
-2
2226
1001
-37
-35
1438
1199
-45
-48
959
979
962
1863
1721
943
-33
1236
1217
1030
-27
-2
1135
-19
1106
1146
933
903
996
1073
949
-7
1162
1002
1721
-34
994
-87
-25
986
1016
-49
1291
1033
1425
1026
1766
1065
973
905
1002
912
1054
1054
1156
982
967
1057
967
1062
920
1052
905
914
1523
912
-21
1114
918
969
2079
927
904
1461
-23
932
901
924
926
1299
977
1002
-72
-26
1731
901
2588
991
1018
921
1145
1049
1094
1541
-32
-3
908
2016
2088
940
933
-33
1482
-