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

INF
INF
INF
1704
INF
1525
7832
1887
473
3306
419
INF
8322
3178
3808
8509
7338
1202
8656
INF
INF
1569
3329
4514
INF
6559
8958
2250
INF
INF
8644
INF
1032
4024
184
4640
6628
INF
2513
INF
98
4540
7102
2222
589
INF
6691
INF
2582
3605
3306
11512
2528
6643
616
362
5124
812
5774
5984
5190
INF
INF
INF
INF
793
893
INF
3377
INF
8287
INF
INF
3701
7317
4625
1131
1882
INF
INF
INF
INF
INF
9286
2512
123
4739
2027
INF
INF
INF
INF
INF
8092
760
8123
2020
373
INF
INF
3976
INF
7569
565
INF
154
2872
7354
8644
INF
432
3337
262
INF
2630
262
122
3015
2310
5928
2394
3098
1041
2548
1754
1102
1777
INF
5938
INF
1848
INF
649
1944
4373
3944
8912
3169
8352
5421
4441
5656
2368
2139
7733
8355
INF
953
2017
1988
INF
3521
INF
INF
1654
4775
346
4055
INF
INF
INF
8537
856
INF
791
1461
2979
INF
2360
INF
726
INF
768
7134
2505
INF
786
4796
INF
3311
2068
3141
1859
6131
2043
716
INF
46
6699
19
6012
2576
6494
6344
460
INF
INF
2292
3437
INF
377
6028
1274
3735
INF
382
INF
INF
6602
INF
3023
6162
6494
1309
2167
7461
INF
3179
5023
2434
693
INF
2764
5708
INF
2

JOJ Answer

338
174
851
407
530
215
646
219
321
249
351
275
116
155
290
268
558
1021
310
398
239
160
154
330
152
441
259
213
131
98
335
171
257
278
140
53
181
92
127
225
98
561
436
225
374
109
227
286
421
137
249
213
200
203
229
362
129
164
416
265
178
192
111
378
279
670
233
520
193
201
405
166
182
251
201
244
217
467
248
724
134
161
36
307
148
123
201
314
-18
511
243
161
107
244
243
112
332
373
100
94
183
639
229
60
206
154
247
230
111
171
84
273
115
186
655
115
95
341
156
143
298
352
199
168
219
140
810
265
342
257
193
378
278
539
219
639
212
82
448
127
263
147
527
77
642
524
230
69
313
272
352
362
712
78
358
670
346
387
283
266
113
211
169
103
109
246
180
180
324
293
279
231
225
171
94
531
54
91
160
304
217
245
129
241
247
267
325
46
146
19
337
376
168
180
181
178
333
102
454
421
377
247
674
286
222
99
201
64
-2
595
157
235
201
187
176
190
240
124
152
40
126
216
615
281
279
260
236
166
527
229
414
61
201
406
197
236
240
265
51
203
304
184
241
365
138
177
451
345
86
891
203
674
192
172
271
382
303
158
393
179
302
213