QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#430460#8650. Island Hoppingegypt_ioi2024_04#28 6ms10244kbC++202.2kb2024-06-03 20:40:222024-06-03 20:40:23

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 2
Accepted

Test #1:

score: 2
Accepted
time: 1ms
memory: 8104kb

input:

3 9
3
1
0
2
3
2
0

output:

1 1
3 1
-1 3
1 2
2 1
3 2
-2 3
0 0

result:

ok 

Test #2:

score: 2
Accepted
time: 1ms
memory: 8148kb

input:

3 9
3
1
0
2
3
2
0

output:

1 1
3 1
-1 3
1 2
2 1
3 2
-2 3
0 0

result:

ok 

Test #3:

score: 2
Accepted
time: 0ms
memory: 8148kb

input:

3 9
2
1
0
3
2
3
0

output:

1 1
2 1
-1 2
1 2
3 1
2 2
-2 3
0 0

result:

ok 

Subtask #2:

score: 4
Accepted

Test #4:

score: 4
Accepted
time: 1ms
memory: 8440kb

input:

299 89401
79
1
0
213
1
0
20
89
242
2
0
286
2
0
192
3
0
244
3
0
69
4
0
227
4
0
99
5
0
233
5
0
29
6
0
244
6
0
272
7
0
277
7
0
54
8
0
83
8
0
67
9
0
149
9
0
72
10
0
276
10
0
163
11
0
278
11
0
196
12
0
226
12
0
216
13
0
239
13
0
60
14
0
268
14
0
225
15
0
293
15
0
101
16
0
113
16
0
43
17
0
159
17
0
23
18
...

output:

1 1
79 1
-1 79
1 2
213 1
-1 213
1 3
20 1
2 1
242 1
-2 242
2 2
286 1
-2 286
3 1
192 1
-3 192
3 2
244 1
-3 244
4 1
69 1
-4 69
4 2
227 1
-4 227
5 1
99 1
-5 99
5 2
233 1
-5 233
6 1
29 1
-6 29
6 2
244 2
-6 244
7 1
272 1
-7 272
7 2
277 1
-7 277
8 1
54 1
-8 54
8 2
83 1
-8 83
9 1
67 1
-9 67
9 2
149 1
-9 149...

result:

ok 

Test #5:

score: 4
Accepted
time: 3ms
memory: 8316kb

input:

300 90000
15
1
0
220
1
0
55
27
17
2
0
130
2
0
10
3
0
200
3
0
153
4
0
269
4
0
43
5
0
147
5
0
12
6
0
36
6
0
32
7
0
50
7
0
178
8
0
218
8
0
14
9
0
181
9
0
174
10
0
79
11
0
208
11
0
261
12
0
44
13
0
260
13
0
295
14
0
199
15
0
229
16
0
288
16
0
53
17
0
256
18
0
266
18
0
66
19
0
236
19
0
159
20
0
295
20
0
...

output:

1 1
15 1
-1 15
1 2
220 1
-1 220
1 3
55 1
2 1
17 1
-2 17
2 2
130 1
-2 130
3 1
10 1
-3 10
3 2
200 1
-3 200
4 1
153 1
-4 153
4 2
269 1
-4 269
5 1
43 1
-5 43
5 2
147 1
-5 147
6 1
12 1
-6 12
6 2
36 1
-6 36
7 1
32 1
-7 32
7 2
50 1
-7 50
8 1
178 1
-8 178
8 2
218 1
-8 218
9 1
14 1
-9 14
9 2
181 1
-9 181
10 ...

result:

ok 

Test #6:

score: 4
Accepted
time: 0ms
memory: 8512kb

input:

300 90000
171
1
0
201
1
0
22
57
20
2
0
209
2
0
47
3
0
131
3
0
17
4
0
250
4
0
208
5
0
284
5
0
27
6
0
83
6
0
25
7
0
61
7
0
119
8
0
196
8
0
40
9
0
157
9
0
167
10
0
196
10
0
62
11
0
100
11
0
209
12
0
256
12
0
163
13
0
184
13
0
65
14
0
297
14
0
157
15
0
193
15
0
99
16
0
161
16
0
272
17
0
198
18
0
267
18
...

output:

1 1
171 1
-1 171
1 2
201 1
-1 201
1 3
22 1
2 1
20 1
-2 20
2 2
209 1
-2 209
3 1
47 1
-3 47
3 2
131 1
-3 131
4 1
17 1
-4 17
4 2
250 1
-4 250
5 1
208 1
-5 208
5 2
284 1
-5 284
6 1
27 1
-6 27
6 2
83 1
-6 83
7 1
25 1
-7 25
7 2
61 1
-7 61
8 1
119 1
-8 119
8 2
196 1
-8 196
9 1
40 1
-9 40
9 2
157 1
-9 157
1...

result:

ok 

Test #7:

score: 4
Accepted
time: 1ms
memory: 8420kb

input:

300 90000
176
1
0
297
1
0
55
275
43
2
0
45
2
0
168
3
0
254
3
0
100
4
0
285
4
0
290
5
0
291
5
0
171
6
0
234
6
0
121
7
0
299
7
0
196
8
0
238
8
0
199
9
0
210
9
0
189
10
0
232
10
0
12
11
0
261
11
0
284
12
0
238
13
0
251
13
0
67
14
0
173
14
0
17
15
0
288
15
0
24
16
0
115
16
0
242
17
0
90
18
0
166
18
0
12...

output:

1 1
176 1
-1 176
1 2
297 1
-1 297
1 3
55 1
2 1
43 1
-2 43
2 2
45 1
-2 45
3 1
168 1
-3 168
3 2
254 1
-3 254
4 1
100 1
-4 100
4 2
285 1
-4 285
5 1
290 1
-5 290
5 2
291 1
-5 291
6 1
171 1
-6 171
6 2
234 1
-6 234
7 1
121 1
-7 121
7 2
299 1
-7 299
8 1
196 1
-8 196
8 2
238 1
-8 238
9 1
199 1
-9 199
9 2
21...

result:

ok 

Test #8:

score: 4
Accepted
time: 0ms
memory: 8324kb

input:

300 90000
96
1
0
162
1
0
26
162
28
2
0
282
2
0
19
3
0
239
3
0
107
4
0
161
4
0
160
5
0
165
5
0
259
6
0
271
6
0
34
7
0
90
7
0
114
8
0
169
8
0
78
9
0
188
9
0
92
10
0
146
10
0
219
11
0
226
11
0
100
12
0
258
12
0
61
13
0
140
13
0
129
14
0
174
14
0
44
15
0
251
15
0
196
16
0
283
16
0
39
17
0
199
17
0
125
1...

output:

1 1
96 1
-1 96
1 2
162 1
-1 162
1 3
26 1
2 1
28 1
-2 28
2 2
282 1
-2 282
3 1
19 1
-3 19
3 2
239 1
-3 239
4 1
107 1
-4 107
4 2
161 1
-4 161
5 1
160 1
-5 160
5 2
165 1
-5 165
6 1
259 1
-6 259
6 2
271 1
-6 271
7 1
34 1
-7 34
7 2
90 1
-7 90
8 1
114 1
-8 114
8 2
169 1
-8 169
9 1
78 1
-9 78
9 2
188 1
-9 1...

result:

ok 

Subtask #3:

score: 0
Wrong Answer

Test #9:

score: 0
Wrong Answer
time: 6ms
memory: 8404kb

input:

299 598
43
1
0
151
1
0
66
43
91
2
0
119
2
0
7
3
0
130
3
0
115
4
0
139
4
0
50
5
0
109
5
0
157
6
0
176
6
0
181
7
0
106
8
0
138
8
0
147
9
0
235
9
0
44
10
0
197
10
0
31
11
0
64
11
0
150
12
0
210
12
0
195
13
0
271
13
0
113
14
0
196
14
0
265
15
0
295
15
0
171
16
0
251
16
0
47
17
0
145
17
0
103
18
0
106
18...

output:

1 1
43 1
-1 43
1 2
151 1
-1 151
1 3
66 1
2 1
91 1
-2 91
2 2
119 1
-2 119
3 1
7 1
-3 7
3 2
130 1
-3 130
4 1
115 1
-4 115
4 2
139 1
-4 139
5 1
50 1
-5 50
5 2
109 1
-5 109
6 1
157 1
-6 157
6 2
176 1
-6 176
7 2
181 1
-7 181
8 1
106 1
-8 106
8 2
138 1
-8 138
9 1
147 1
-9 147
9 2
235 1
-9 235
10 1
44 1
-1...

result:

wrong answer Wrong Answer [3]

Subtask #4:

score: 9
Accepted

Test #15:

score: 9
Accepted
time: 0ms
memory: 8452kb

input:

299 89401
29
1
0
35
1
0
171
1
0
153
2
0
230
2
0
166
3
0
181
3
0
54
4
0
266
4
0
65
5
0
159
5
0
75
6
0
176
6
0
166
7
0
241
7
0
9
8
0
83
8
0
250
9
0
88
10
0
141
10
0
19
11
0
68
19
193
12
0
224
12
0
154
13
0
215
13
0
26
14
0
228
14
0
73
15
0
221
15
0
271
16
0
50
53
231
17
0
239
17
0
44
18
0
107
18
0
68
...

output:

1 1
29 1
-1 29
1 2
35 1
-1 35
1 3
171 1
-1 171
2 1
153 1
-2 153
2 2
230 1
-2 230
3 1
166 1
-3 166
3 2
181 1
-3 181
4 1
54 1
-4 54
4 2
266 1
-4 266
5 1
65 1
-5 65
5 2
159 1
-5 159
6 1
75 1
-6 75
6 2
176 1
-6 176
7 1
166 2
-7 166
7 2
241 1
-7 241
8 1
9 1
-8 9
8 2
83 1
-8 83
9 2
250 1
-9 250
10 1
88 1
...

result:

ok 

Test #16:

score: 9
Accepted
time: 0ms
memory: 10056kb

input:

300 90000
28
1
0
60
1
0
183
1
0
74
2
0
142
2
0
200
3
0
229
3
0
257
4
0
295
4
0
74
5
0
221
5
0
67
6
0
25
67
119
7
0
163
7
0
23
8
0
276
8
0
185
9
0
231
9
0
239
10
0
277
10
0
244
11
0
285
11
0
19
12
0
132
12
0
109
13
0
173
13
0
257
14
0
283
14
0
76
15
0
298
15
0
184
16
0
253
16
0
20
17
0
242
17
0
122
1...

output:

1 1
28 1
-1 28
1 2
60 1
-1 60
1 3
183 1
-1 183
2 1
74 1
-2 74
2 2
142 1
-2 142
3 1
200 1
-3 200
3 2
229 1
-3 229
4 1
257 1
-4 257
4 2
295 1
-4 295
5 1
74 2
-5 74
5 2
221 1
-5 221
6 1
67 1
-6 67
6 2
25 1
7 1
119 1
-7 119
7 2
163 1
-7 163
8 1
23 1
-8 23
8 2
276 1
-8 276
9 1
185 1
-9 185
9 2
231 1
-9 2...

result:

ok 

Test #17:

score: 9
Accepted
time: 0ms
memory: 8368kb

input:

300 90000
24
1
0
162
1
0
167
1
0
129
2
0
268
2
0
21
3
0
285
3
0
151
4
0
225
4
0
32
5
0
258
5
0
68
6
0
248
6
0
19
7
0
260
7
0
133
8
0
292
8
0
152
9
0
195
9
0
30
10
0
173
10
0
27
11
0
149
11
0
200
12
0
267
12
0
37
13
0
126
13
0
63
14
0
282
14
0
82
15
0
165
15
0
72
16
0
167
16
0
122
17
0
280
17
0
279
1...

output:

1 1
24 1
-1 24
1 2
162 1
-1 162
1 3
167 1
-1 167
2 1
129 1
-2 129
2 2
268 1
-2 268
3 1
21 1
-3 21
3 2
285 1
-3 285
4 1
151 1
-4 151
4 2
225 1
-4 225
5 1
32 1
-5 32
5 2
258 1
-5 258
6 1
68 1
-6 68
6 2
248 1
-6 248
7 1
19 1
-7 19
7 2
260 1
-7 260
8 1
133 1
-8 133
8 2
292 1
-8 292
9 1
152 1
-9 152
9 2
...

result:

ok 

Test #18:

score: 9
Accepted
time: 3ms
memory: 8404kb

input:

300 90000
107
1
0
138
1
0
277
1
0
125
2
0
178
2
0
147
3
0
196
3
0
143
4
0
158
4
0
199
5
0
282
5
0
56
6
0
202
6
0
54
7
0
201
7
0
205
8
0
206
8
0
67
9
0
136
9
0
155
10
0
214
10
0
18
11
0
270
11
0
112
12
0
279
12
0
77
13
0
200
13
0
98
14
0
154
14
0
218
15
0
232
15
0
17
16
0
153
16
0
278
17
0
248
18
0
6...

output:

1 1
107 1
-1 107
1 2
138 1
-1 138
1 3
277 1
-1 277
2 1
125 1
-2 125
2 2
178 1
-2 178
3 1
147 1
-3 147
3 2
196 1
-3 196
4 1
143 1
-4 143
4 2
158 1
-4 158
5 1
199 1
-5 199
5 2
282 1
-5 282
6 1
56 1
-6 56
6 2
202 1
-6 202
7 1
54 1
-7 54
7 2
201 1
-7 201
8 1
205 1
-8 205
8 2
206 1
-8 206
9 1
67 1
-9 67
...

result:

ok 

Test #19:

score: 9
Accepted
time: 0ms
memory: 8412kb

input:

300 90000
65
1
0
88
1
0
283
1
0
54
2
0
267
2
0
189
3
0
274
3
0
232
4
0
283
4
0
81
5
0
128
5
0
168
6
0
276
6
0
243
7
0
246
7
0
108
8
0
225
8
0
216
9
0
254
9
0
123
10
0
143
10
0
19
11
0
194
11
0
220
12
0
287
12
0
45
13
0
182
13
0
41
14
0
204
14
0
71
15
0
259
15
0
21
16
0
65
16
0
188
17
0
260
17
0
46
1...

output:

1 1
65 1
-1 65
1 2
88 1
-1 88
1 3
283 1
-1 283
2 1
54 1
-2 54
2 2
267 1
-2 267
3 1
189 1
-3 189
3 2
274 1
-3 274
4 1
232 1
-4 232
4 2
283 2
-4 283
5 1
81 1
-5 81
5 2
128 1
-5 128
6 1
168 1
-6 168
6 2
276 1
-6 276
7 1
243 1
-7 243
7 2
246 1
-7 246
8 1
108 1
-8 108
8 2
225 1
-8 225
9 1
216 1
-9 216
9 ...

result:

ok 

Test #20:

score: 9
Accepted
time: 3ms
memory: 10244kb

input:

299 89401
124
1
0
149
1
0
153
1
0
18
2
0
254
2
0
76
3
0
202
3
0
23
4
0
31
4
0
27
5
0
196
5
0
112
6
0
193
6
0
130
7
0
215
7
0
66
8
0
119
8
0
85
9
0
247
9
0
163
10
0
185
10
0
39
11
0
259
11
0
28
12
0
126
12
0
124
13
0
180
13
0
152
14
0
271
14
0
55
15
0
242
15
0
250
16
0
261
16
0
44
17
0
143
17
0
31
18...

output:

1 1
124 1
-1 124
1 2
149 1
-1 149
1 3
153 1
-1 153
2 1
18 1
-2 18
2 2
254 1
-2 254
3 1
76 1
-3 76
3 2
202 1
-3 202
4 1
23 1
-4 23
4 2
31 1
-4 31
5 1
27 1
-5 27
5 2
196 1
-5 196
6 1
112 1
-6 112
6 2
193 1
-6 193
7 1
130 1
-7 130
7 2
215 1
-7 215
8 1
66 1
-8 66
8 2
119 1
-8 119
9 1
85 1
-9 85
9 2
247 ...

result:

ok 

Test #21:

score: 9
Accepted
time: 6ms
memory: 8400kb

input:

300 90000
107
1
0
159
1
0
183
1
0
151
2
0
263
2
0
196
3
0
210
3
0
68
4
0
86
4
0
165
5
0
276
5
0
198
6
0
286
6
0
133
7
0
176
7
0
102
8
0
137
8
0
136
9
0
138
9
0
75
10
0
78
10
0
73
11
0
222
11
0
73
12
0
153
12
0
58
13
0
74
13
0
141
14
0
215
14
0
72
15
0
140
15
0
24
16
0
125
16
0
88
17
0
191
17
0
280
1...

output:

1 1
107 1
-1 107
1 2
159 1
-1 159
1 3
183 1
-1 183
2 1
151 1
-2 151
2 2
263 1
-2 263
3 1
196 1
-3 196
3 2
210 1
-3 210
4 1
68 1
-4 68
4 2
86 1
-4 86
5 1
165 1
-5 165
5 2
276 1
-5 276
6 1
198 1
-6 198
6 2
286 1
-6 286
7 1
133 1
-7 133
7 2
176 1
-7 176
8 1
102 1
-8 102
8 2
137 1
-8 137
9 1
136 1
-9 13...

result:

ok 

Test #22:

score: 9
Accepted
time: 3ms
memory: 8288kb

input:

300 90000
38
1
0
112
1
0
211
1
0
244
2
0
261
2
0
265
3
0
290
3
0
125
4
0
126
4
0
224
5
0
264
5
0
67
6
0
98
6
0
79
7
0
148
7
0
61
8
0
162
8
0
76
9
0
177
9
0
227
10
0
229
10
0
137
11
0
197
11
0
145
12
0
217
12
0
31
13
0
186
13
0
111
14
0
172
14
0
127
15
0
256
15
0
95
16
0
118
16
0
122
17
0
201
17
0
32...

output:

1 1
38 1
-1 38
1 2
112 1
-1 112
1 3
211 1
-1 211
2 1
244 1
-2 244
2 2
261 1
-2 261
3 1
265 1
-3 265
3 2
290 1
-3 290
4 1
125 1
-4 125
4 2
126 1
-4 126
5 1
224 1
-5 224
5 2
264 1
-5 264
6 1
67 1
-6 67
6 2
98 1
-6 98
7 1
79 1
-7 79
7 2
148 1
-7 148
8 1
61 1
-8 61
8 2
162 1
-8 162
9 1
76 1
-9 76
9 2
17...

result:

ok 

Subtask #5:

score: 13
Accepted

Test #23:

score: 13
Accepted
time: 6ms
memory: 8376kb

input:

299 897
140
1
0
269
1
0
276
1
0
39
2
0
121
2
0
67
3
0
86
3
0
214
4
0
262
4
0
234
5
0
244
5
0
122
6
0
146
6
0
174
7
0
240
7
0
227
8
0
237
8
0
206
9
0
281
9
0
65
10
0
275
10
0
41
11
0
254
11
0
211
12
0
272
12
0
117
13
0
199
13
0
51
14
0
165
14
0
152
15
0
207
15
0
195
16
0
235
16
0
28
17
0
225
17
0
143...

output:

1 1
140 1
-1 140
1 2
269 1
-1 269
1 3
276 1
-1 276
2 1
39 1
-2 39
2 2
121 1
-2 121
3 1
67 1
-3 67
3 2
86 1
-3 86
4 1
214 1
-4 214
4 2
262 1
-4 262
5 1
234 1
-5 234
5 2
244 1
-5 244
6 1
122 1
-6 122
6 2
146 1
-6 146
7 1
174 1
-7 174
7 2
240 1
-7 240
8 1
227 1
-8 227
8 2
237 1
-8 237
9 1
206 1
-9 206
...

result:

ok 

Test #24:

score: 13
Accepted
time: 0ms
memory: 8464kb

input:

300 900
46
1
0
127
1
0
191
1
0
64
2
0
126
2
0
55
3
0
257
3
0
94
4
0
105
4
0
100
5
0
234
5
0
43
6
0
300
6
0
71
7
0
240
7
0
216
8
0
269
8
0
189
9
0
233
9
0
281
10
0
294
10
0
233
11
0
246
11
0
172
12
0
204
12
0
108
13
0
124
13
0
116
14
0
125
14
0
102
15
0
252
15
0
67
16
0
205
16
0
178
17
0
201
17
0
22
...

output:

1 1
46 1
-1 46
1 2
127 1
-1 127
1 3
191 1
-1 191
2 1
64 1
-2 64
2 2
126 1
-2 126
3 1
55 1
-3 55
3 2
257 1
-3 257
4 1
94 1
-4 94
4 2
105 1
-4 105
5 1
100 1
-5 100
5 2
234 1
-5 234
6 1
43 1
-6 43
6 2
300 1
-6 300
7 1
71 1
-7 71
7 2
240 1
-7 240
8 1
216 1
-8 216
8 2
269 1
-8 269
9 1
189 1
-9 189
9 2
23...

result:

ok 

Test #25:

score: 13
Accepted
time: 5ms
memory: 8460kb

input:

300 900
60
1
0
131
1
0
298
1
0
116
2
0
118
2
0
72
3
0
274
3
0
100
4
0
117
4
0
150
5
0
199
5
0
88
6
0
203
6
0
148
7
0
190
7
0
125
8
0
267
8
0
14
9
0
157
9
0
109
10
0
188
10
0
58
11
0
176
11
0
181
12
0
240
12
0
215
13
0
288
13
0
192
14
0
137
15
0
262
15
0
222
16
0
273
16
0
116
17
0
194
17
0
79
18
0
21...

output:

1 1
60 1
-1 60
1 2
131 1
-1 131
1 3
298 1
-1 298
2 1
116 1
-2 116
2 2
118 1
-2 118
3 1
72 1
-3 72
3 2
274 1
-3 274
4 1
100 1
-4 100
4 2
117 1
-4 117
5 1
150 1
-5 150
5 2
199 1
-5 199
6 1
88 1
-6 88
6 2
203 1
-6 203
7 1
148 1
-7 148
7 2
190 1
-7 190
8 1
125 1
-8 125
8 2
267 1
-8 267
9 1
14 1
-9 14
9 ...

result:

ok 

Test #26:

score: 13
Accepted
time: 0ms
memory: 8464kb

input:

300 900
8
1
0
179
1
0
200
1
0
212
2
0
246
2
0
14
3
0
262
3
0
94
4
0
117
4
0
32
5
0
70
5
0
117
6
0
188
6
0
107
7
0
178
7
0
132
8
0
77
9
0
175
9
0
30
10
0
65
10
0
56
11
0
243
11
0
37
12
0
129
12
0
59
13
0
174
13
0
237
14
0
32
15
0
100
15
0
47
16
0
298
16
0
92
17
0
123
17
0
260
18
0
275
18
0
160
19
0
2...

output:

1 1
8 1
-1 8
1 2
179 1
-1 179
1 3
200 1
-1 200
2 1
212 1
-2 212
2 2
246 1
-2 246
3 1
14 1
-3 14
3 2
262 1
-3 262
4 1
94 1
-4 94
4 2
117 1
-4 117
5 1
32 1
-5 32
5 2
70 1
-5 70
6 1
117 2
-6 117
6 2
188 1
-6 188
7 1
107 1
-7 107
7 2
178 1
-7 178
8 2
132 1
-8 132
9 1
77 1
-9 77
9 2
175 1
-9 175
10 1
30 ...

result:

ok 

Test #27:

score: 13
Accepted
time: 6ms
memory: 8476kb

input:

300 900
94
1
0
172
1
0
267
1
0
175
2
0
227
2
0
79
3
0
192
3
0
111
4
0
300
4
0
180
5
0
215
5
0
30
6
0
130
6
0
80
7
0
196
7
0
65
8
0
108
8
0
12
9
0
238
9
0
174
10
0
228
10
0
191
11
0
279
11
0
206
12
0
107
13
0
109
13
0
161
14
0
264
14
0
53
15
0
123
15
0
169
16
0
201
16
0
129
17
0
135
17
0
103
18
0
247...

output:

1 1
94 1
-1 94
1 2
172 1
-1 172
1 3
267 1
-1 267
2 1
175 1
-2 175
2 2
227 1
-2 227
3 1
79 1
-3 79
3 2
192 1
-3 192
4 1
111 1
-4 111
4 2
300 1
-4 300
5 1
180 1
-5 180
5 2
215 1
-5 215
6 1
30 1
-6 30
6 2
130 1
-6 130
7 1
80 1
-7 80
7 2
196 1
-7 196
8 1
65 1
-8 65
8 2
108 1
-8 108
9 1
12 1
-9 12
9 2
23...

result:

ok 

Test #28:

score: 13
Accepted
time: 0ms
memory: 8368kb

input:

300 900
4
1
0
12
1
0
58
1
0
179
2
0
236
2
0
49
3
0
263
3
0
36
4
0
219
5
0
271
5
0
107
6
0
272
6
0
69
7
0
99
7
0
51
8
0
177
8
0
153
9
0
185
9
0
138
10
0
183
10
0
213
11
0
286
11
0
293
12
0
197
13
0
204
13
0
280
14
0
281
14
0
60
15
0
72
15
0
61
16
0
70
16
0
62
17
0
199
17
0
48
18
0
59
18
0
216
19
0
22...

output:

1 1
4 1
-1 4
1 2
12 1
-1 12
1 3
58 1
-1 58
2 1
179 1
-2 179
2 2
236 1
-2 236
3 1
49 1
-3 49
3 2
263 1
-3 263
4 2
36 1
-4 36
5 1
219 1
-5 219
5 2
271 1
-5 271
6 1
107 1
-6 107
6 2
272 1
-6 272
7 1
69 1
-7 69
7 2
99 1
-7 99
8 1
51 1
-8 51
8 2
177 1
-8 177
9 1
153 1
-9 153
9 2
185 1
-9 185
10 1
138 1
-...

result:

ok 

Test #29:

score: 13
Accepted
time: 6ms
memory: 8456kb

input:

299 897
56
1
0
138
1
0
273
1
0
42
2
0
261
42
244
3
0
271
3
0
174
4
0
278
4
0
41
5
0
191
5
0
43
6
0
188
6
0
136
7
0
205
7
0
36
8
0
234
8
0
14
9
0
85
9
0
70
10
0
188
10
0
108
11
0
145
11
0
151
12
0
221
12
0
146
13
0
263
13
0
253
14
0
119
15
0
193
15
0
53
16
0
93
16
0
66
17
0
172
17
0
70
18
0
98
18
0
6...

output:

1 1
56 1
-1 56
1 2
138 1
-1 138
1 3
273 1
-1 273
2 1
42 1
-2 42
2 2
261 1
3 1
244 1
-3 244
3 2
271 1
-3 271
4 1
174 1
-4 174
4 2
278 1
-4 278
5 1
41 1
-5 41
5 2
191 1
-5 191
6 1
43 1
-6 43
6 2
188 1
-6 188
7 1
136 1
-7 136
7 2
205 1
-7 205
8 1
36 1
-8 36
8 2
234 1
-8 234
9 1
14 1
-9 14
9 2
85 1
-9 8...

result:

ok 

Test #30:

score: 13
Accepted
time: 0ms
memory: 8444kb

input:

300 900
127
1
0
219
1
0
267
1
0
238
2
0
264
2
0
173
3
0
266
3
0
29
4
0
55
4
0
66
5
0
233
5
0
18
6
0
208
6
0
39
7
0
132
7
0
41
8
0
73
8
0
14
9
0
83
9
0
42
10
0
197
10
0
153
11
0
232
11
0
49
12
0
212
12
0
188
13
0
283
13
0
255
14
0
157
15
0
243
15
0
109
16
0
117
16
0
25
17
0
107
17
0
85
18
0
231
19
0
...

output:

1 1
127 1
-1 127
1 2
219 1
-1 219
1 3
267 1
-1 267
2 1
238 1
-2 238
2 2
264 1
-2 264
3 1
173 1
-3 173
3 2
266 1
-3 266
4 1
29 1
-4 29
4 2
55 1
-4 55
5 1
66 1
-5 66
5 2
233 1
-5 233
6 1
18 1
-6 18
6 2
208 1
-6 208
7 1
39 1
-7 39
7 2
132 1
-7 132
8 1
41 1
-8 41
8 2
73 1
-8 73
9 1
14 1
-9 14
9 2
83 1
-...

result:

ok 

Test #31:

score: 13
Accepted
time: 0ms
memory: 8456kb

input:

300 900
96
1
0
144
1
0
170
1
0
7
2
0
132
2
0
125
3
0
260
3
0
171
4
0
183
4
0
200
5
0
277
5
0
207
6
0
286
6
0
248
7
0
61
8
0
62
8
0
94
9
0
298
9
0
147
10
0
236
10
0
117
11
0
162
11
0
82
12
0
129
12
0
74
13
0
201
13
0
60
14
0
283
14
0
135
15
0
282
15
0
225
16
0
296
16
0
228
17
0
265
17
0
217
18
0
276
...

output:

1 1
96 1
-1 96
1 2
144 1
-1 144
1 3
170 1
-1 170
2 1
7 1
-2 7
2 2
132 1
-2 132
3 1
125 1
-3 125
3 2
260 1
-3 260
4 1
171 1
-4 171
4 2
183 1
-4 183
5 1
200 1
-5 200
5 2
277 1
-5 277
6 1
207 1
-6 207
6 2
286 1
-6 286
7 2
248 1
-7 248
8 1
61 1
-8 61
8 2
62 1
-8 62
9 1
94 1
-9 94
9 2
298 1
-9 298
10 1
1...

result:

ok 

Subtask #6:

score: 0
Wrong Answer

Test #32:

score: 0
Wrong Answer
time: 0ms
memory: 8444kb

input:

300 90000
133
1
0
179
1
0
89
133
82
2
0
47
82
65
3
0
165
65
266
4
0
283
4
0
29
5
0
40
5
0
24
6
0
35
6
0
28
7
0
234
7
0
86
8
0
199
86
186
9
0
299
54
109
10
0
231
10
0
29
11
0
221
11
0
105
12
0
112
12
0
128
13
0
277
13
0
117
14
0
126
14
0
108
15
0
231
108
247
16
0
118
77
131
12
234
18
0
7
94
19
0
210
...

output:

1 1
133 1
-1 133
1 2
179 1
-1 179
1 3
89 1
2 1
82 1
-2 82
2 2
47 1
3 1
65 1
-3 65
3 2
165 1
4 1
266 1
-4 266
4 2
283 1
-4 283
5 1
29 1
-5 29
5 2
40 1
-5 40
6 1
24 1
-6 24
6 2
35 1
-6 35
7 1
28 1
-7 28
7 2
234 1
-7 234
8 1
86 1
-8 86
8 2
199 1
9 1
186 1
-9 186
9 2
299 1
10 1
109 1
-10 109
10 2
231 1
...

result:

wrong answer Wrong Answer [1]

Subtask #7:

score: 0
Wrong Answer

Test #58:

score: 0
Wrong Answer
time: 0ms
memory: 8344kb

input:

300 900
201
1
0
228
1
0
171
10
88
2
0
262
88
97
3
0
104
3
0
35
4
0
183
4
0
96
5
0
98
5
0
70
6
0
138
6
0
60
7
0
141
7
0
23
8
0
80
8
0
46
9
0
51
39
76
10
0
171
0
43
11
0
180
11
0
69
12
0
203
12
0
141
13
0
173
13
0
95
14
0
168
91
159
15
0
166
132
264
16
0
89
110
196
17
0
233
17
0
119
18
0
293
18
0
32
1...

output:

1 1
201 1
-1 201
1 2
228 1
-1 228
1 3
171 1
2 1
88 1
-2 88
2 2
262 1
3 1
97 1
-3 97
3 2
104 1
-3 104
4 1
35 1
-4 35
4 2
183 1
-4 183
5 1
96 1
-5 96
5 2
98 1
-5 98
6 1
70 1
-6 70
6 2
138 1
-6 138
7 1
60 1
-7 60
7 2
141 1
-7 141
8 1
23 1
-8 23
8 2
80 1
-8 80
9 1
46 1
-9 46
9 2
51 1
10 1
76 1
-10 76
10...

result:

wrong answer Wrong Answer [1]

Subtask #8:

score: 0
Wrong Answer

Test #84:

score: 0
Wrong Answer
time: 6ms
memory: 8388kb

input:

299 598
86
1
0
94
1
0
224
94
79
2
0
228
2
0
49
3
0
166
3
0
124
4
0
138
83
257
5
0
262
5
0
51
6
0
129
6
0
214
7
0
55
51
20
8
0
206
8
0
50
9
0
64
9
0
177
10
0
262
77
200
11
0
209
11
0
238
12
0
150
35
66
13
0
223
13
0
15
14
0
92
15
92
0
38
16
0
68
38
229
17
0
254
187
175
18
0
263
18
0
193
19
0
31
91
28...

output:

1 1
86 1
-1 86
1 2
94 1
-1 94
1 3
224 1
2 1
79 1
-2 79
2 2
228 1
-2 228
3 1
49 1
-3 49
3 2
166 1
-3 166
4 1
124 1
-4 124
4 2
138 1
5 1
257 1
-5 257
5 2
262 1
-5 262
6 1
51 1
-6 51
6 2
129 1
-6 129
7 1
214 1
-7 214
7 2
55 1
8 1
20 1
-8 20
8 2
206 1
-8 206
9 1
50 1
-9 50
9 2
64 1
-9 64
10 1
177 1
-10 ...

result:

wrong answer Wrong Answer [3]