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

4
3
1
4
2
7253845
3871215
-200
3
1
4
2
7253845
7021972
3871215
-200
-200
3
1
4
2
7253845
7021972
3871215
3871215
-200
3
1
4
2
7253845
7021972
3871215
-200
-200
3
1
4
2
7253845
8675146
7021972
3871215
-200
3
1
4
2
7253845
8675146
7021972
3871215
3871215
-200
-200
3
1
4
2
7253845
742085
8675146
7021972
3871215
-200
3
1
4
2
7253845
742085
8675146
7021972
8877064
3871215
3871215
-200
-200
3
1
4
2
7253845
742085
8675146
7021972
8877064
3871215
-200
8877064
3871215
-200
3
1
4
2
2879553
7253845
742085
8675146
7021972
8877064
3871215
-200
3
1
4
2
2879553
7253845
742085
8675146
7021972
8877064
3871215
-200
-200
-200
3
1
4
2
2879553
7253845
742085
8675146
7021972
8877064
3871215
-200
7021972
-200
-200
-200
-200
3871215
7021972
-200
3
1
4
2
9717509
3870486
2879553
7253845
742085
9231846
8675146
401826
7021972
8877064
3871215
-200
3
1
4
2
9717509
3870486
2879553
7253845
742085
9231846
8675146
401826
7021972
8877064
3871215
-200
3
1
4
2
9717509
3870486
2879553
7253845
742085
9231846
8675146
401826
7021972
8877064
3871215

JOJ Answer

4
3
2
4
7253845
3871215
-200
3
2
4
7253845
3871215
7021972
-200
-200
3
2
4
7253845
3871215
7021972
3871215
-200
3
2
4
7253845
3871215
7021972
-200
-200
3
2
4
7253845
8675146
3871215
7021972
-200
3
2
4
7253845
8675146
3871215
7021972
3871215
-200
-200
3
2
4
7253845
8675146
3871215
742085
7021972
-200
3
2
4
7253845
8675146
3871215
742085
7021972
8877064
3871215
-200
-200
3
2
4
7253845
8675146
3871215
742085
7021972
8877064
-200
8877064
3871215
-200
3
2
4
7253845
8675146
3871215
742085
7021972
2879553
8877064
-200
3
2
4
7253845
8675146
3871215
742085
7021972
2879553
8877064
-200
-200
-200
3
2
4
7253845
8675146
3871215
742085
7021972
2879553
8877064
-200
7021972
-200
-200
-200
-200
3871215
7021972
-200
3
2
4
9717509
9231846
7253845
3870486
8675146
401826
3871215
742085
7021972
2879553
8877064
-200
3
2
4
9717509
9231846
7253845
3870486
8675146
401826
3871215
742085
7021972
2879553
8877064
-200
3
2
4
9717509
9231846
7253845
3870486
8675146
401826
3871215
742085
7021972
2879553
8877064
7021972
8877064
-200
-200
3
2