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

105 6604
0 2 8800
0 3 1169
0 4 4528
0 5 4218
0 7 7698
0 9 7912
0 10 8479
0 12 2593
0 13 3913
0 15 75
0 16 5650
0 18 1555
0 19 8068
0 21 2629
0 22 1284
0 27 339
0 28 6009
0 30 184
0 31 492
0 33 7808
0 35 4566
0 37 652
0 38 5508
0 40 2615
0 44 8173
0 45 1574
0 46 0
0 47 8622
0 48 3415
0 51 2630
0 52 4794
0 53 9189
0 54 4101
0 56 1451
0 57 687
0 61 4219
0 64 4853
0 66 2595
0 69 3579
0 70 7229
0 71 6895
0 72 3585
0 74 3669
0 78 2753
0 80 6511
0 81 -6
0 82 3755
0 84 5479
0 85 1636
0 87 1083
0 88 377
0 89 7237
0 91 3531
0 92 3426
0 93 6900
0 97 3629
0 98 7755
0 99 7184
0 102 2501
0 103 5035
0 104 8147
1 0 7111
1 5 2779
1 6 8601
1 7 347
1 8 2936
1 9 4804
1 10 1567
1 11 5000
1 12 3037
1 13 1582
1 14 1804
1 15 9053
1 16 7983
1 18 2409
1 19 1280
1 20 4611
1 26 9298
1 27 6856
1 29 8071
1 30 2980
1 31 836
1 33 5062
1 34 -3
1 37 7054
1 38 7042
1 39 4441
1 40 9378
1 41 6461
1 42 8060
1 44 8839
1 47 8375
1 49 6388
1 50 6486
1 51 4615
1 54 2533
1 56 327
1 57 2035
1 58 6391
1 60 1220
1 61 5907
1 62 7259
1 65 5572
1 68 653
1 6

JOJ Answer

166
248
205
182
32
249
27
590
184
408
8
245
322
6
70
153
0
67
135
113
162
82
191
113
509
91
248
158
14
121
149
168
232
121
105
129
179
231
365
190
424
235
235
155
165
144
147
209
169
188
89
233
140
21
75
161
204
89
290
77
114
165
308
155
201
303
237
134
-3
229
110
199
145
219
180
236
344
503
269
306
157
408
187
174
278
440
184
172
252
291
357
237
196
277
213
158
149
303
219
208
226
130
125
163
317
299
128
185
214
205
507
159
342
138
128
294
170
159
159
255
37
160
243
243
419
204
209
252
134
99
83
278
57
147
165
219
229
100
159
187
139
139
442
136
6
168
194
204
214
163
166
156
292
201
160
74
315
351
193
313
189
152
214
161
169
119
53
174
197
254
90
217
88
119
319
206
206
322
191
129
118
244
162
362
152
198
-6
115
173
112
175
298
213
283
176
96
274
153
100
167
595
256
143
432
534
209
205
190
229
332
107
178
80
5
55
200
84
95
518
115
498
243
252
201
549
443
224
99
156
137
119
120
115
230
101
460
133
153
114
260
184
127
276
352
270
88
71
203
173
70
266
129
197
47
340
56
137
317
98
275
128
309
205
333
386
207
283