QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#375782#7598. Steel Ball RunLoverInTimeAC ✓1004ms107580kbC++174.3kb2024-04-03 15:49:362024-04-03 15:49:36

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 32544kb

input:

3
1 2
2 3
4
+ 1
+ 3
+ 2
- 1

output:

0
2
2
1

result:

ok 4 number(s): "0 2 2 1"

Test #2:

score: 0
Accepted
time: 0ms
memory: 32648kb

input:

6
1 2
2 3
3 4
4 5
2 6
5
+ 1
+ 4
+ 5
- 5
+ 6

output:

0
3
4
3
4

result:

ok 5 number(s): "0 3 4 3 4"

Test #3:

score: 0
Accepted
time: 8ms
memory: 34964kb

input:

100
50 1
1 36
1 93
93 91
91 66
66 19
54 93
11 36
93 48
12 93
54 58
31 66
1 83
93 13
83 25
93 63
9 93
41 1
56 91
93 8
9 27
24 1
36 79
72 8
71 72
25 44
79 18
59 93
46 54
72 85
81 24
15 50
27 16
44 62
84 1
6 66
44 30
63 4
53 62
60 4
47 48
19 55
36 49
59 69
18 86
70 55
71 99
23 41
43 85
78 69
1 77
26 49...

output:

0
6
6
8
10
12
15
18
22
25
26
28
27
29
32
31
31
36
38
42
46
51
52
57
60
66
63
67
71
73
70
73
70
73
77
80
84
83
84
81
85
88
86
88
92
95
99
100
96
101
99
104
106
108
104
106
103
106
105
107
105
109
112
113
119
123
127
131
130
133
137
140
138
141
136
138
132
134
136
133
131
132
133
129
126
129
131
137
1...

result:

ok 10000 numbers

Test #4:

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

input:

100
26 34
95 34
53 26
24 95
80 24
68 95
80 17
34 100
17 98
69 34
98 60
68 76
72 26
24 67
95 88
19 76
19 94
36 69
62 94
36 37
6 36
98 77
85 37
95 12
70 19
72 13
60 33
36 61
23 70
36 97
72 32
69 99
35 80
37 7
64 95
65 24
39 98
14 64
68 58
85 3
58 27
96 23
33 57
58 2
17 43
46 19
51 35
11 67
52 36
38 6
...

output:

0
11
0
13
0
7
0
10
0
10
0
13
0
9
0
8
0
6
0
4
0
8
0
3
0
7
0
8
0
5
0
4
0
3
0
5
0
7
0
3
0
3
0
4
0
7
0
8
0
8
0
5
0
4
0
5
0
10
0
11
0
3
0
8
0
9
0
6
0
7
0
7
0
8
0
10
0
7
0
6
0
6
0
1
0
6
0
7
0
8
0
6
0
8
0
7
0
9
0
6
0
7
0
7
0
5
0
8
0
1
0
3
0
8
0
6
0
7
0
9
0
6
0
5
0
7
0
4
0
3
0
8
0
4
0
1
0
4
0
2
0
2
0
7
0
9
...

result:

ok 10000 numbers

Test #5:

score: 0
Accepted
time: 3ms
memory: 39216kb

input:

100
95 83
12 83
12 93
12 63
83 53
57 12
83 65
91 95
79 63
83 29
61 91
61 51
80 51
95 62
29 90
44 93
93 34
80 40
82 93
8 51
85 79
65 10
13 90
9 79
57 56
90 54
66 57
91 20
47 83
63 27
51 46
51 41
87 95
7 9
5 47
52 7
51 14
41 26
64 13
77 52
3 7
68 51
11 64
3 86
5 50
83 30
76 5
45 61
47 35
11 69
9 55
6 ...

output:

0
2
13
16
26
34
40
43
47
53
58
59
68
72
75
79
81
88
92
98
104
107
110
114
117
120
115
122
117
126
122
119
120
124
121
125
116
109
111
110
116
112
115
109
111
110
118
123
119
124
121
116
118
120
116
111
117
115
118
123
116
120
117
120
117
113
115
113
118
116
122
126
120
116
119
122
118
112
115
116
11...

result:

ok 10000 numbers

Test #6:

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

input:

100
1 60
54 60
79 54
60 78
51 79
25 54
1 88
78 33
86 88
43 60
51 75
51 26
2 75
54 15
43 90
79 49
60 89
99 88
87 89
8 99
2 85
72 2
61 60
49 17
83 54
5 26
36 1
60 92
82 89
78 67
68 2
17 13
87 62
45 13
16 79
16 3
38 85
63 88
49 77
40 62
54 100
87 84
65 49
4 15
17 6
59 40
31 51
76 90
47 83
83 44
97 60
8...

output:

0
6
12
16
21
24
26
30
32
38
45
49
52
60
64
67
74
77
79
84
85
90
95
100
104
111
118
123
127
130
133
139
144
153
155
158
164
168
171
176
178
183
188
191
198
202
206
211
213
218
220
221
227
232
234
239
241
243
251
254
257
258
260
263
267
274
276
281
285
287
289
295
299
300
301
304
302
298
302
296
296
2...

result:

ok 10000 numbers

Test #7:

score: 0
Accepted
time: 3ms
memory: 35024kb

input:

100
18 44
57 44
57 71
35 71
57 93
57 12
89 12
63 71
63 22
63 11
57 51
26 63
93 41
44 34
35 31
66 11
93 17
53 18
32 93
9 17
54 18
63 64
91 32
52 35
34 23
8 91
80 57
84 34
7 31
84 43
54 67
7 29
68 11
42 51
42 24
11 87
51 98
90 7
80 99
47 8
59 84
12 40
9 50
16 26
44 81
16 48
68 27
66 6
26 78
48 55
15 4...

output:

0
7
10
15
16
18
22
22
25
29
33
37
42
45
50
54
58
59
63
67
69
72
77
82
85
87
90
92
98
103
107
109
112
115
118
121
128
132
137
141
144
146
149
153
157
159
161
163
167
170
176
177
181
184
188
193
198
203
205
209
212
216
221
226
229
232
235
240
244
249
252
254
258
260
265
270
274
280
282
287
292
293
297...

result:

ok 10000 numbers

Test #8:

score: 0
Accepted
time: 8ms
memory: 32828kb

input:

100
42 38
62 42
62 56
56 86
86 16
26 86
16 34
16 3
26 52
62 82
78 26
27 78
78 40
15 26
93 56
40 76
64 26
57 27
27 73
28 34
67 93
52 4
73 58
57 55
78 29
76 80
76 51
28 45
82 33
51 95
40 41
29 31
68 57
67 75
64 100
37 26
63 37
56 5
34 74
12 57
50 51
100 30
68 69
94 41
50 48
57 32
69 10
99 94
97 12
94 ...

output:

0
5
8
13
18
23
27
29
32
36
38
43
39
43
49
55
56
58
53
58
64
67
72
75
80
85
80
75
79
78
85
90
94
98
100
103
107
112
116
120
125
128
134
129
130
126
131
135
139
142
146
146
151
156
162
157
155
151
156
163
161
168
172
166
170
165
161
164
159
155
158
151
156
152
154
157
163
167
162
166
172
176
178
183
1...

result:

ok 10000 numbers

Test #9:

score: 0
Accepted
time: 7ms
memory: 39092kb

input:

100
55 64
49 55
55 3
3 7
7 26
30 7
9 26
24 3
24 27
9 63
96 9
43 27
15 96
7 88
42 15
96 22
32 42
36 22
36 12
89 24
25 22
12 38
43 51
88 11
19 24
51 77
35 36
12 33
78 12
55 2
78 31
77 76
80 27
34 35
81 77
27 18
81 73
4 81
62 77
37 51
22 65
12 41
56 42
73 17
31 68
99 73
58 25
44 99
35 87
78 59
99 14
75...

output:

0
4
0
7
0
5
0
5
0
4
0
5
0
4
0
8
0
9
0
11
0
9
0
8
0
12
0
7
0
10
0
8
0
3
0
8
0
7
0
13
0
7
0
8
0
7
0
9
0
7
0
9
0
10
0
10
0
4
0
7
0
1
0
1
0
11
0
6
0
8
0
10
0
6
0
4
0
5
0
10
0
10
0
6
0
11
0
11
0
11
0
10
0
10
0
6
0
8
0
12
0
4
0
7
0
6
0
12
0
6
0
10
0
6
0
4
0
4
0
7
0
10
0
10
0
12
0
7
0
12
0
12
0
3
0
9
0
7
0...

result:

ok 10000 numbers

Test #10:

score: 0
Accepted
time: 3ms
memory: 35440kb

input:

100
51 83
54 83
28 54
94 51
94 76
60 54
76 35
70 60
10 83
70 98
70 59
3 76
41 98
30 41
5 98
98 66
85 98
5 81
66 24
54 82
88 24
41 12
11 98
81 22
68 5
82 58
22 57
56 57
73 5
95 41
5 61
89 88
100 30
42 11
88 79
70 69
39 79
90 79
57 40
48 5
56 26
38 95
73 43
11 67
72 24
72 78
43 6
99 67
57 14
6 37
100 ...

output:

0
4
11
15
18
25
31
33
39
45
50
54
61
67
71
76
77
79
85
90
95
99
106
110
111
119
113
109
113
111
115
113
115
111
115
118
117
119
115
116
111
105
109
105
108
106
110
106
108
106
110
104
108
103
109
104
110
112
106
100
105
98
103
99
107
110
108
110
102
107
102
100
102
106
102
105
100
107
100
105
99
95
...

result:

ok 10000 numbers

Test #11:

score: 0
Accepted
time: 8ms
memory: 39072kb

input:

100
53 90
53 10
53 18
53 82
59 53
98 59
59 21
18 65
18 67
87 67
21 28
67 94
87 14
68 18
71 28
8 28
98 11
49 65
24 21
40 8
64 94
74 98
61 64
42 59
73 67
33 67
93 74
57 73
27 67
61 47
26 73
74 69
8 37
31 57
33 23
58 74
99 93
62 11
26 54
93 56
32 11
76 87
42 79
12 79
69 34
52 56
27 3
1 52
79 5
17 31
47...

output:

0
10
15
17
23
26
28
30
33
37
45
53
61
68
69
77
81
84
86
92
97
98
99
102
105
113
118
122
126
133
138
143
148
154
158
163
169
173
175
179
183
189
198
204
207
210
216
225
230
237
243
246
250
252
258
267
277
281
287
292
298
305
308
316
320
328
331
336
338
343
344
350
354
357
359
366
362
357
360
357
363
...

result:

ok 10000 numbers

Test #12:

score: 0
Accepted
time: 8ms
memory: 39196kb

input:

100
3 12
56 12
56 29
3 72
56 77
72 24
100 72
63 72
29 51
56 82
65 100
98 51
20 51
63 97
100 13
63 6
63 38
20 70
73 3
20 30
38 71
6 44
44 67
78 30
65 92
92 19
10 65
72 94
56 17
85 38
87 65
78 5
31 44
96 72
89 17
88 38
89 28
25 20
88 4
88 66
98 90
48 88
72 50
86 88
70 23
63 21
66 37
49 44
79 21
30 8
8...

output:

0
4
9
13
14
17
24
26
34
37
39
45
51
56
65
72
83
91
95
99
102
105
111
116
121
127
129
137
143
144
147
150
151
156
159
162
171
174
179
186
191
194
197
201
204
208
217
221
233
235
238
241
245
249
253
255
262
266
277
281
286
291
294
304
316
321
324
326
327
335
339
343
345
348
351
356
360
362
368
380
384...

result:

ok 10000 numbers

Test #13:

score: 0
Accepted
time: 7ms
memory: 37124kb

input:

100
5 26
44 5
5 27
44 32
77 44
33 5
91 26
44 62
98 5
84 44
27 72
90 27
57 26
92 5
98 88
37 44
30 5
62 60
82 91
32 81
26 93
57 65
8 88
92 64
85 92
58 77
5 97
5 83
23 27
26 31
27 10
50 84
100 98
51 84
60 43
55 91
21 77
41 90
86 98
56 26
32 22
62 96
29 8
18 92
45 32
91 40
44 38
58 14
100 36
90 67
16 88...

output:

0
5
9
13
17
18
21
17
19
24
27
29
32
29
31
33
29
31
34
35
39
44
48
51
52
54
53
56
59
54
55
60
56
52
49
51
55
54
58
61
63
66
64
65
68
70
74
78
75
78
75
78
76
79
82
85
89
91
88
85
88
85
89
88
92
93
90
93
96
99
102
100
104
109
107
104
100
101
97
95
96
94
90
92
96
101
99
102
99
101
105
108
112
113
116
11...

result:

ok 10000 numbers

Test #14:

score: 0
Accepted
time: 7ms
memory: 36900kb

input:

100
77 16
77 23
16 33
77 69
66 33
33 35
23 12
93 77
16 100
16 79
12 49
14 77
16 91
52 23
23 78
27 79
16 29
20 69
14 48
61 35
24 35
60 91
49 72
100 71
70 12
93 84
45 35
91 53
93 3
66 2
32 29
33 17
79 18
4 27
25 79
98 71
74 100
38 17
62 60
84 83
28 72
99 71
77 87
1 25
69 5
67 32
52 10
2 81
25 22
62 68...

output:

0
4
0
3
0
4
0
3
0
4
0
6
0
1
0
1
0
3
0
2
0
3
0
3
0
3
0
1
0
3
0
3
0
3
0
2
0
2
0
3
0
2
0
2
0
4
0
4
0
4
0
3
0
4
0
4
0
2
0
3
0
2
0
4
0
8
0
7
0
8
0
7
0
4
0
3
0
2
0
4
0
3
0
2
0
4
0
4
0
3
0
4
0
4
0
2
0
4
0
3
0
7
0
5
0
5
0
4
0
3
0
5
0
3
0
4
0
4
0
4
0
3
0
3
0
1
0
4
0
2
0
2
0
4
0
2
0
3
0
3
0
2
0
6
0
3
0
2
0
6
...

result:

ok 10000 numbers

Test #15:

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

input:

100
10 94
94 74
54 74
98 94
25 54
40 74
94 16
45 10
27 40
37 16
25 13
53 25
31 16
37 47
27 67
85 27
75 54
47 52
56 45
10 82
59 10
23 98
53 63
37 12
4 52
74 2
21 82
37 97
58 98
74 73
94 44
27 76
82 61
3 45
40 81
96 37
33 16
56 30
12 7
54 91
88 37
97 1
71 13
94 24
59 35
68 85
28 37
99 40
2 49
12 19
43...

output:

0
6
9
13
17
20
25
29
31
35
39
43
45
50
53
56
60
64
68
70
76
81
85
88
93
89
92
88
90
88
92
92
89
86
90
86
89
93
89
86
91
91
93
96
94
90
93
90
95
100
95
89
92
95
92
97
93
94
91
88
92
95
93
95
91
87
90
86
90
94
89
86
89
84
86
81
86
81
83
87
85
81
85
81
84
82
84
87
83
78
81
79
83
88
85
89
87
84
88
91
89...

result:

ok 10000 numbers

Test #16:

score: 0
Accepted
time: 7ms
memory: 37096kb

input:

100
5 11
5 64
95 11
5 38
62 38
64 68
5 49
5 35
11 73
48 64
5 44
7 35
49 52
64 9
95 53
82 7
81 52
49 31
83 64
23 5
11 26
9 1
95 78
61 26
49 28
11 65
95 18
72 95
74 48
95 97
71 5
39 38
81 94
24 81
69 44
15 7
53 47
61 92
35 10
29 49
52 59
85 7
13 48
55 65
73 21
35 84
8 92
97 43
5 80
30 24
45 53
51 82
2...

output:

0
5
7
10
14
17
21
24
27
31
34
40
42
45
49
50
55
57
60
63
66
69
72
74
78
83
86
90
93
96
99
102
104
108
112
115
116
118
122
125
128
131
136
138
140
144
147
150
151
155
159
163
166
168
170
174
175
178
182
186
186
191
196
199
202
206
208
211
213
218
221
223
227
231
233
234
230
233
229
230
226
231
229
23...

result:

ok 10000 numbers

Test #17:

score: 0
Accepted
time: 5ms
memory: 37216kb

input:

100
86 94
94 71
98 86
75 86
66 94
53 86
49 94
93 98
86 28
94 100
51 75
24 49
26 94
66 47
17 47
93 31
17 8
43 49
30 100
62 98
35 93
56 86
80 75
75 38
24 46
27 100
28 41
27 92
97 71
15 51
8 11
30 99
33 31
19 80
86 69
62 12
68 35
62 16
67 43
27 48
66 29
17 70
86 55
13 30
1 28
93 42
78 15
52 29
7 71
74 ...

output:

0
5
9
12
15
17
22
27
30
33
35
41
42
46
50
54
58
60
62
64
67
70
72
74
77
80
82
83
85
88
89
93
96
98
100
101
106
106
110
115
118
122
123
126
131
134
138
143
144
147
149
154
156
158
160
163
168
171
175
178
181
184
186
190
196
201
203
207
211
213
218
222
228
232
235
237
241
246
249
252
254
259
265
269
2...

result:

ok 10000 numbers

Test #18:

score: 0
Accepted
time: 11ms
memory: 34852kb

input:

100
85 30
85 15
76 15
76 69
78 69
7 78
23 7
23 14
20 14
20 52
52 3
3 5
5 37
17 37
37 4
71 4
45 17
90 71
71 84
84 41
64 84
100 41
64 66
90 93
93 88
66 44
44 26
66 80
10 26
61 10
61 72
38 72
72 9
72 33
38 46
73 33
65 61
61 24
27 88
11 38
24 32
11 83
11 55
75 73
81 32
9 31
8 83
8 25
56 81
8 89
56 60
53...

output:

0
2
7
12
13
17
19
28
45
52
64
68
82
88
93
99
106
111
121
135
131
134
139
145
158
179
184
198
193
187
191
195
204
227
233
226
232
240
244
261
275
273
268
252
257
263
257
262
269
254
262
279
296
303
307
310
297
281
267
246
268
267
243
249
255
261
255
259
255
269
271
265
256
264
244
248
256
262
265
266...

result:

ok 10000 numbers

Test #19:

score: 0
Accepted
time: 7ms
memory: 34880kb

input:

100
97 4
81 97
1 81
1 46
81 76
39 76
39 37
37 98
98 31
58 98
58 49
93 49
93 87
100 87
50 87
14 50
54 100
72 50
7 50
82 72
56 82
80 56
56 10
89 72
61 82
89 11
35 89
61 29
47 11
47 19
29 24
26 29
16 26
23 26
41 47
26 51
83 26
51 94
64 51
51 32
51 15
73 15
62 64
32 21
21 12
12 69
32 63
84 69
63 42
78 1...

output:

0
24
0
10
0
15
0
29
0
21
0
22
0
24
0
25
0
26
0
12
0
12
0
9
0
24
0
2
0
22
0
13
0
29
0
23
0
27
0
26
0
21
0
26
0
26
0
12
0
16
0
11
0
20
0
24
0
20
0
23
0
23
0
25
0
23
0
12
0
23
0
2
0
31
0
25
0
22
0
3
0
27
0
24
0
26
0
1
0
28
0
30
0
18
0
24
0
25
0
17
0
1
0
12
0
29
0
29
0
25
0
4
0
25
0
25
0
26
0
21
0
28
0
...

result:

ok 10000 numbers

Test #20:

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

input:

100
80 97
35 97
28 35
7 28
7 54
23 54
95 23
95 71
71 83
12 83
12 2
71 39
2 57
90 12
57 63
98 63
76 98
44 90
44 86
87 86
63 61
61 73
58 44
29 86
100 76
6 87
42 6
73 70
61 36
66 36
94 66
74 94
81 74
6 48
10 74
52 48
72 48
52 75
75 24
24 18
78 75
53 24
53 9
9 16
30 72
92 9
30 89
78 47
1 47
1 99
1 65
18...

output:

0
17
24
28
37
44
55
58
67
73
77
85
94
109
118
126
129
141
149
156
165
166
178
188
188
181
185
174
187
197
185
177
189
198
189
175
176
165
170
164
170
156
167
177
175
164
175
183
168
179
165
162
173
183
172
169
180
169
177
188
178
163
166
178
167
178
165
155
169
161
162
148
162
148
149
152
138
142
13...

result:

ok 10000 numbers

Test #21:

score: 0
Accepted
time: 3ms
memory: 32964kb

input:

100
100 50
100 82
5 82
24 5
82 35
35 91
19 91
19 23
23 20
12 20
12 29
38 29
23 67
55 67
76 55
77 55
44 55
68 44
68 98
44 59
99 59
59 75
59 14
14 97
75 79
43 79
22 79
97 71
22 21
15 21
72 43
11 21
87 11
21 83
83 9
11 81
64 83
22 39
64 88
15 25
4 81
25 53
53 37
89 37
81 51
86 25
89 66
86 60
60 54
51 9...

output:

0
6
10
20
24
35
40
49
57
65
67
73
82
87
97
103
111
116
125
137
150
159
167
167
175
180
191
199
213
220
226
227
230
244
248
251
259
269
273
287
294
295
298
307
314
321
330
336
340
343
351
352
354
360
367
372
376
378
385
394
403
409
421
431
443
450
455
462
465
471
482
489
492
500
502
495
502
499
500
5...

result:

ok 10000 numbers

Test #22:

score: 0
Accepted
time: 6ms
memory: 37532kb

input:

100
60 13
13 20
20 14
14 4
64 14
64 63
64 76
79 76
57 79
57 84
17 57
17 12
28 84
78 28
11 78
11 65
65 47
94 47
47 32
32 75
32 48
92 48
87 92
82 87
92 16
56 82
94 100
82 24
24 8
8 70
70 74
74 5
96 5
96 25
25 27
86 27
74 77
85 96
86 80
23 80
56 93
36 23
93 53
36 3
34 53
66 23
34 9
36 45
9 46
72 45
18 ...

output:

0
30
41
53
53
69
80
85
92
101
109
125
139
146
152
166
184
199
214
220
231
245
260
270
286
287
298
312
323
327
341
360
372
377
388
403
417
429
442
454
465
467
473
485
496
500
514
532
542
558
575
594
597
607
616
629
635
650
661
671
686
704
722
732
738
753
767
782
797
808
816
830
845
865
873
887
891
90...

result:

ok 10000 numbers

Test #23:

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

input:

100
90 78
78 21
78 8
57 78
89 78
80 78
78 51
90 93
90 99
87 78
49 78
78 40
78 33
47 78
39 78
26 78
78 29
11 78
98 90
57 31
78 5
86 78
90 37
78 55
51 41
90 65
78 13
78 94
78 3
8 18
78 82
83 21
8 24
61 8
66 93
50 78
21 81
69 90
70 8
27 21
71 21
78 63
25 78
84 21
78 74
90 68
56 8
1 33
45 90
43 89
21 48...

output:

0
3
4
6
8
11
12
14
15
14
13
14
16
17
19
21
23
25
23
25
27
28
26
28
30
31
33
34
36
38
40
42
41
43
45
46
47
49
51
50
53
52
53
53
51
53
55
53
51
53
55
57
55
57
59
62
63
66
67
69
71
68
69
70
68
66
68
70
68
69
70
72
73
75
77
75
74
76
77
75
77
78
79
77
75
76
75
73
75
74
75
77
78
80
81
83
85
88
90
88
90
88...

result:

ok 10000 numbers

Test #24:

score: 0
Accepted
time: 3ms
memory: 33276kb

input:

100
75 65
40 65
65 5
65 37
66 65
100 75
90 65
65 95
41 65
65 4
65 15
5 29
58 65
27 75
40 57
65 42
75 67
5 47
77 65
65 59
71 65
60 40
14 65
93 65
65 26
75 3
65 28
66 19
22 66
9 75
35 40
74 37
36 5
65 12
18 37
40 34
40 17
65 85
65 48
43 65
65 63
65 84
37 38
79 65
15 70
65 6
65 33
55 75
5 91
64 40
7 95...

output:

0
4
0
4
0
5
0
2
0
3
0
4
0
4
0
4
0
4
0
2
0
3
0
3
0
1
0
2
0
2
0
2
0
2
0
1
0
2
0
2
0
1
0
1
0
2
0
2
0
1
0
2
0
1
0
2
0
3
0
2
0
1
0
2
0
2
0
1
0
2
0
2
0
2
0
2
0
2
0
3
0
1
0
2
0
2
0
1
0
1
0
3
0
1
0
2
0
2
0
1
0
1
0
2
0
1
0
2
0
1
0
2
0
2
0
1
0
1
0
2
0
2
0
2
0
2
0
2
0
2
0
2
0
2
0
3
0
1
0
2
0
1
0
2
0
2
0
1
0
2
...

result:

ok 10000 numbers

Test #25:

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

input:

100
81 90
33 90
60 90
39 90
90 29
98 90
90 3
15 33
90 52
62 90
33 73
90 88
90 43
50 90
90 10
42 90
90 58
81 27
93 90
64 81
68 81
20 81
56 90
29 97
51 81
71 81
90 36
60 6
33 23
34 81
65 81
90 74
81 76
66 39
13 90
47 33
60 84
73 46
83 90
60 89
29 69
15 54
18 15
48 98
5 60
11 81
90 75
92 90
55 90
87 33...

output:

0
3
5
6
8
10
12
14
16
18
19
21
23
26
28
30
33
34
36
37
39
40
43
44
47
45
47
49
47
44
45
47
45
47
46
44
45
48
46
45
46
44
46
43
45
43
45
47
45
43
45
47
44
47
45
42
43
41
43
42
44
42
44
46
44
43
45
47
45
47
44
42
43
46
45
43
45
43
44
45
43
41
43
41
43
42
43
42
44
42
43
44
42
43
41
43
41
40
42
44
42
44...

result:

ok 10000 numbers

Test #26:

score: 0
Accepted
time: 7ms
memory: 32868kb

input:

100
81 30
60 81
81 68
81 91
78 30
30 59
81 75
38 81
14 81
11 30
44 81
45 81
70 30
93 91
37 68
81 19
68 69
68 65
95 30
81 12
81 5
81 99
60 18
30 2
47 30
97 81
28 30
81 27
30 72
38 17
16 60
81 79
25 68
60 50
34 60
78 55
78 23
81 8
68 56
30 6
82 68
81 33
87 38
30 83
91 49
68 29
30 96
30 21
46 81
30 32
...

output:

0
3
4
6
8
9
10
12
15
17
19
21
23
24
26
28
29
30
31
33
35
37
38
39
40
42
43
45
47
49
51
53
55
57
59
61
64
67
69
72
74
76
77
79
81
83
85
86
88
90
92
93
95
98
101
102
104
106
108
110
113
114
116
118
119
120
121
123
126
128
130
133
135
137
138
136
138
136
139
141
139
138
140
140
137
135
138
139
137
135
...

result:

ok 10000 numbers

Test #27:

score: 0
Accepted
time: 5ms
memory: 35148kb

input:

100
100 24
24 15
24 95
54 24
10 24
25 24
1 24
24 36
7 24
100 5
15 3
24 12
45 24
30 100
98 24
20 24
24 9
51 24
82 24
85 15
24 21
48 95
95 79
75 15
24 14
34 24
43 24
32 100
65 24
90 25
42 25
84 15
6 24
53 24
93 15
49 24
31 95
27 95
15 19
24 58
95 47
13 24
83 15
100 16
57 95
62 24
96 1
56 100
64 10
60 ...

output:

0
3
4
5
7
9
11
13
15
16
17
18
20
22
23
24
26
27
28
30
31
34
36
38
39
41
43
45
47
48
50
51
52
54
55
56
57
59
60
62
64
66
68
70
71
73
75
77
79
81
82
84
86
88
89
90
91
93
95
97
98
99
101
103
104
106
108
110
112
114
116
117
119
119
120
122
124
126
127
129
130
132
134
135
138
140
142
143
145
147
149
150
...

result:

ok 10000 numbers

Test #28:

score: 0
Accepted
time: 303ms
memory: 83944kb

input:

100000
75107 45998
75107 5241
5241 265
45998 68245
68166 265
19680 75107
65721 19680
65721 46269
265 96520
31717 5241
19680 63801
84421 75107
84421 62969
63801 53458
84421 67758
66325 53458
19680 30688
87253 68166
5241 83210
88909 84421
19680 67084
67084 40715
96520 80170
53688 19680
53688 33385
629...

output:

0
15
26
34
45
59
67
85
94
108
115
122
125
143
153
161
177
183
201
217
226
242
254
272
281
290
309
316
324
334
345
356
369
379
386
398
413
422
430
442
454
463
475
488
496
509
524
532
550
558
572
581
597
611
620
630
638
644
654
660
670
682
692
703
710
721
736
751
762
773
788
794
801
809
813
821
831
84...

result:

ok 100000 numbers

Test #29:

score: 0
Accepted
time: 305ms
memory: 81968kb

input:

100000
18529 98457
95441 98457
98457 2966
97765 18529
2966 5381
95441 45838
45838 70788
5381 46370
51055 5381
2099 46370
45838 40343
192 5381
18529 45451
95441 91533
97765 71050
68599 45838
65091 45838
43662 97765
66737 46370
20266 98457
2966 61711
39564 40343
20266 56589
29030 2966
8606 39564
91680...

output:

0
13
23
31
42
49
57
63
70
89
104
113
125
140
150
160
173
185
197
211
223
231
239
257
267
280
285
296
307
317
326
335
354
362
370
381
390
399
414
424
434
450
469
481
489
499
514
520
529
537
544
554
565
581
596
605
615
624
636
650
659
666
675
681
694
707
712
722
728
733
743
758
770
780
792
801
812
821...

result:

ok 100000 numbers

Test #30:

score: 0
Accepted
time: 308ms
memory: 82964kb

input:

100000
48177 93029
1654 48177
93029 95379
15741 48177
15741 38781
49562 38781
48177 94592
48177 10481
49562 62810
10481 38443
62629 38443
23378 48177
66268 93029
15319 15741
69626 15319
93029 636
48177 46695
62569 62810
43084 15319
40420 636
69626 29279
29279 29543
13322 62629
29543 51096
69626 3399...

output:

0
17
22
36
46
60
71
83
92
102
109
116
127
144
156
160
163
173
186
198
208
218
230
237
249
259
265
276
287
293
298
305
308
317
326
341
353
363
374
387
396
405
415
428
439
451
465
475
489
502
512
518
533
539
552
566
577
591
599
611
624
635
646
657
668
681
694
704
719
728
737
749
762
773
784
796
806
81...

result:

ok 100000 numbers

Test #31:

score: 0
Accepted
time: 278ms
memory: 81816kb

input:

100000
46787 74830
38317 74830
74830 28120
74830 85161
85161 24704
62067 74830
46787 86507
74830 85077
80000 62067
91028 62067
91028 55737
86507 11971
86507 80421
86507 36664
80421 81941
81941 85073
85161 35506
80000 93486
35506 65179
2802 74830
67157 74830
35506 30192
6546 80421
67784 81941
54392 1...

output:

0
26
36
45
58
75
87
101
114
120
132
143
153
163
169
183
195
203
213
227
246
259
271
280
291
306
314
324
339
352
362
378
385
397
407
426
437
449
466
481
493
515
528
536
552
563
574
583
596
601
610
616
622
630
639
648
655
667
677
689
699
714
731
741
750
764
771
780
791
797
805
825
836
845
854
868
879
...

result:

ok 100000 numbers

Test #32:

score: 0
Accepted
time: 298ms
memory: 84796kb

input:

100000
1714 86598
86598 79822
65171 1714
93400 79822
18477 65171
95323 86598
1533 95323
65171 40048
1714 84771
88748 95323
33591 84771
20449 88748
72785 18477
54505 20449
49206 65171
72785 52826
72785 32099
51158 84771
86598 69550
69550 83744
1973 32099
7677 69550
2138 51158
53522 18477
26606 83744
...

output:

0
29
36
42
50
59
75
87
99
109
121
132
144
161
169
177
184
193
207
223
238
247
257
268
278
286
296
315
325
331
346
356
366
375
382
394
409
416
421
435
445
464
475
484
490
506
512
526
539
557
562
574
587
601
607
618
626
642
653
663
676
689
697
704
712
720
728
743
750
767
778
791
802
817
833
846
854
87...

result:

ok 100000 numbers

Test #33:

score: 0
Accepted
time: 1004ms
memory: 103712kb

input:

100000
84856 11707
11707 26565
26565 9876
89279 9876
89279 47898
47898 8560
8560 94420
94420 18444
32815 18444
87890 32815
79625 87890
76889 79625
78107 76889
74211 78107
74211 23276
23276 40715
25945 40715
24581 25945
24581 17382
65371 17382
65371 57731
65681 57731
23796 65681
23796 76734
76734 202...

output:

0
34073
69907
110782
110782
135876
138987
195461
195461
242846
286237
307507
342697
374461
384035
395641
403062
435815
447670
464171
491969
503554
551858
598198
637908
660601
671870
687762
718678
737441
746018
760323
780440
787517
796872
804933
823219
877125
939276
944575
973001
1005840
1037320
1075...

result:

ok 100000 numbers

Test #34:

score: 0
Accepted
time: 894ms
memory: 104352kb

input:

100000
52154 28554
28554 53035
82182 53035
12991 82182
12991 36885
31408 36885
31408 53741
53741 2949
40311 2949
40311 73126
81906 73126
81906 50178
57733 50178
57733 35175
79707 35175
2154 79707
2154 56803
56803 42541
73940 42541
53646 73940
53646 29938
91176 29938
91176 84501
96740 84501
69195 967...

output:

0
24811
24811
42616
104597
155221
189123
209223
245192
278632
282183
298286
345909
359155
373523
418991
443947
461620
485672
501870
501870
537267
573408
593036
603334
634989
652488
710970
712679
724619
776951
830486
867555
879897
888687
936699
964022
989818
1022843
1059286
1062761
1064929
1067448
10...

result:

ok 100000 numbers

Test #35:

score: 0
Accepted
time: 931ms
memory: 107580kb

input:

100000
82274 69036
48647 69036
62641 48647
62641 49099
49099 94777
94777 92657
81638 92657
85974 81638
15506 85974
89131 15506
89131 49100
49100 87655
19547 87655
8625 19547
69441 8625
59977 69441
59977 36540
36540 86261
86261 17978
17978 41885
58911 41885
96687 58911
55458 96687
55458 75399
75399 6...

output:

0
19133
54324
55939
79552
96699
123034
160929
173598
202524
214273
245371
284346
310289
327525
371485
390377
424337
451199
489527
489527
498402
498402
533365
563918
578802
586053
604608
640185
643789
676849
713660
729776
738146
773714
821103
862086
875333
907411
932007
968835
1006111
1045713
1069542...

result:

ok 100000 numbers

Test #36:

score: 0
Accepted
time: 976ms
memory: 106720kb

input:

100000
37576 42638
42638 12953
12953 42204
42204 57971
57971 13498
13498 40968
31652 40968
59880 31652
61123 59880
41764 61123
41764 14721
10970 14721
97742 10970
36502 97742
36502 17242
76070 17242
91421 76070
3211 91421
3211 45237
89091 45237
56467 89091
58165 56467
33674 58165
33674 94592
94592 1...

output:

0
21387
46895
50752
81615
81684
108910
121742
146900
176809
204278
249733
312569
328064
374688
419205
441432
455908
455911
512117
514319
535112
540379
552612
595429
654839
702817
721100
729124
739395
797167
805456
830349
873183
912064
923533
940948
957636
1003775
1009569
1036839
1054452
1057593
1085...

result:

ok 100000 numbers

Test #37:

score: 0
Accepted
time: 964ms
memory: 106120kb

input:

100000
47345 82145
82145 58637
58637 2547
28950 2547
28950 1433
1433 75644
69998 75644
69998 27425
27425 6568
8467 6568
8467 67770
67770 69126
18806 69126
18806 15057
91694 15057
91694 40136
29718 40136
30508 29718
30508 44544
24316 44544
24316 87597
87597 57570
57570 49550
88785 49550
88785 14466
1...

output:

0
9027
12276
24465
48079
110412
115118
152370
202617
208898
245273
250644
257995
277701
291714
308746
311934
381723
441351
464421
498487
511769
566325
624780
660350
665317
699011
739190
793926
813835
836108
837852
855425
873603
889794
909893
914159
937259
942829
981548
991959
998752
1052214
1083711
...

result:

ok 100000 numbers

Test #38:

score: 0
Accepted
time: 89ms
memory: 49508kb

input:

100000
54570 695
84882 695
70091 695
695 76023
74595 695
68281 695
63530 695
35927 695
695 45168
31759 695
99803 695
14763 695
80129 695
24960 695
695 43140
695 85183
695 43143
5679 695
55016 695
85602 695
1328 695
13219 695
98808 695
54776 695
53542 695
695 81645
695 41887
12170 695
695 28969
55919...

output:

0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103...

result:

ok 100000 numbers

Test #39:

score: 0
Accepted
time: 87ms
memory: 51884kb

input:

100000
53344 73233
53344 60507
92590 53344
56673 53344
1987 53344
14418 53344
79312 53344
58868 53344
53344 48854
38267 53344
53344 71053
7464 53344
68351 53344
2154 53344
90038 53344
39360 53344
53344 91260
7334 53344
53344 31859
78091 53344
53344 28145
90736 53344
77559 53344
53344 19304
53344 255...

output:

0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
...

result:

ok 100000 numbers

Test #40:

score: 0
Accepted
time: 89ms
memory: 51516kb

input:

100000
50573 16642
16642 62434
12060 16642
7937 16642
89564 16642
16642 99957
23036 16642
16642 36217
34420 16642
16642 68625
16628 16642
57533 16642
63926 16642
95106 16642
40936 16642
16642 21471
3065 16642
16642 78387
16642 26345
12982 16642
48436 16642
16642 48048
91352 16642
29971 16642
26446 1...

output:

0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
...

result:

ok 100000 numbers

Test #41:

score: 0
Accepted
time: 88ms
memory: 50696kb

input:

100000
23595 5558
23595 40255
23595 17739
23595 15512
55850 23595
23595 55565
18567 23595
9034 23595
23595 6385
39698 23595
27951 23595
23595 54279
36090 23595
33889 23595
38798 23595
59356 23595
47567 23595
23595 36141
23595 93474
23595 47641
23595 42062
23595 66338
23595 57419
14274 23595
23595 67...

output:

0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
17
18
19
20
21
22
23
24
25
26
27
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
10...

result:

ok 100000 numbers

Test #42:

score: 0
Accepted
time: 82ms
memory: 53688kb

input:

100000
27650 31796
33484 27650
27650 63286
90988 27650
96559 27650
27650 92010
27650 71997
27650 14709
27650 75895
27650 97728
95361 27650
27650 86745
27650 64799
44896 27650
12660 27650
48210 27650
17575 27650
8622 27650
6028 27650
27650 49512
27650 91556
80976 27650
72834 27650
27650 95103
27650 7...

output:

0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
...

result:

ok 100000 numbers

Test #43:

score: 0
Accepted
time: 161ms
memory: 69508kb

input:

100000
72283 91876
7267 91876
7267 66248
66248 68297
68297 19375
19375 8893
8893 81618
19976 81618
83179 19976
83179 27157
13565 27157
13565 42408
42408 15205
83179 94465
86469 15205
86469 78580
83316 78580
53427 83316
59040 53427
94327 59040
94327 69637
69637 79172
79172 82559
84667 82559
84667 491...

output:

0
2414
6946
11478
11478
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
22163
22164
22165
22166
22167
22168
22169
22170
22171
22172
23578
23579
23580
23581
23582
23583
23584
23585
23586
30869
30870
...

result:

ok 100000 numbers

Test #44:

score: 0
Accepted
time: 153ms
memory: 70964kb

input:

100000
85345 92447
67098 85345
82825 67098
60295 82825
60295 47685
1207 47685
1207 15124
15124 50579
55961 50579
55961 10874
24429 10874
12412 24429
12412 42531
28619 42531
28619 42168
25244 42168
25244 57555
57555 27162
71513 27162
64983 71513
79765 64983
20312 79765
20312 72620
98805 72620
35172 9...

output:

0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
6356
6357
6358
6359
6360
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7...

result:

ok 100000 numbers

Test #45:

score: 0
Accepted
time: 156ms
memory: 69836kb

input:

100000
70698 1513
1513 2155
2155 53954
53954 71455
40146 71455
40146 16552
16552 93179
83465 93179
83465 30939
41348 30939
38239 41348
1197 38239
60785 1197
37365 60785
37365 94545
94545 51688
21536 51688
21536 85590
85590 22438
65305 22438
65305 38210
2384 38210
2384 77414
84243 77414
84243 18924
1...

output:

0
2
3
4
5
6
7
2996
2997
2998
2999
3000
3001
3002
4577
4578
4579
9016
9017
9018
9019
9020
9021
12665
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
22495
22496
22497
22498
31195
31196
31197
31198
31199
31200
31201
31202
31203
31204
31205
31206
31207
31208
31209
31210
31...

result:

ok 100000 numbers

Test #46:

score: 0
Accepted
time: 157ms
memory: 71660kb

input:

100000
32104 75390
75390 32111
28274 32111
28274 11976
95383 11976
95383 66536
43334 66536
55791 43334
8839 55791
8839 39886
76420 39886
76420 47099
87837 47099
23985 87837
74878 23985
13901 74878
13901 15307
2933 15307
66100 23985
2933 37187
58034 37187
58034 35724
72863 35724
43490 72863
32685 434...

output:

0
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
13087
13088
13089
13090
16078
16079
16080
16081
16082
16083
16084
16085
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19...

result:

ok 100000 numbers

Test #47:

score: 0
Accepted
time: 149ms
memory: 73500kb

input:

100000
30131 54718
54718 91218
89844 91218
68372 89844
68372 48744
21389 48744
21389 80530
41952 80530
41952 51667
51667 5263
41867 5263
76814 41867
76814 81303
68980 81303
50368 68980
9239 50368
9239 30969
30969 13551
13551 27645
27645 66855
80406 66855
80406 20335
43143 20335
5240 43143
5240 59455...

output:

0
129
130
131
132
133
134
135
136
7580
7581
7582
14013
14014
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
18634
18635
18636
18637
18638
23266
26235
26236
26237
26238
26239...

result:

ok 100000 numbers

Test #48:

score: 0
Accepted
time: 264ms
memory: 77316kb

input:

100000
20103 70992
64342 20103
64342 17182
17182 32105
26632 32105
62098 26632
33218 62098
33218 33727
33727 58451
58451 11334
11334 82991
82991 6682
6682 96556
96556 51574
4771 51574
4771 59581
90761 59581
90761 77847
49619 77847
49619 48449
82282 48449
82282 81923
54910 81923
54910 81
46868 81
390...

output:

0
10842
15301
19760
19760
20801
20802
20803
36753
36754
36755
36756
36757
36758
36759
36760
36761
36762
36763
37127
51701
51702
51703
51704
51705
51706
51707
51708
51709
64174
88162
88163
88164
89573
89574
89575
111284
111285
111286
111287
124019
125879
125880
125881
130073
130074
130075
130076
1300...

result:

ok 100000 numbers

Test #49:

score: 0
Accepted
time: 247ms
memory: 80740kb

input:

100000
34757 4831
4831 99691
99691 82868
51636 82868
24780 51636
24780 23506
23506 95753
54624 95753
2233 54624
2233 76493
75801 76493
75801 24579
5796 24579
3178 5796
3178 95195
95195 10368
10368 5995
86384 5995
86384 90739
31313 90739
31313 83325
83325 47611
47611 12055
67725 12055
67725 90168
315...

output:

0
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
21549
25076
29563
29564
29565
29566
29567
29568
29569
29570
29571
29572
36805
36807
36808
36809
36810
36811
36812
36813
54787
54788
54789
54790
54791
54792
54793
67786
82181
82182
82183
82184
82185
82186
82187
82188
82189
105998
10599...

result:

ok 100000 numbers

Test #50:

score: 0
Accepted
time: 269ms
memory: 79116kb

input:

100000
24735 23979
48534 23979
44523 48534
49408 44523
49408 37755
46326 37755
98371 46326
98371 43232
43232 10684
81610 10684
41694 81610
38464 41694
38464 69514
69514 93001
93001 76270
45631 76270
42531 45631
94848 42531
3567 94848
50812 3567
58637 50812
58637 20378
20378 71337
71337 24905
24905 4...

output:

0
2
20206
20207
33069
33070
48661
70390
70391
70392
86777
87340
87341
105197
105198
116421
116422
116423
116424
117824
117825
138728
151033
171117
193261
194666
195230
195794
195795
195796
196125
196126
196127
196128
210922
210923
221672
221673
244686
244687
244688
244689
259643
260792
281883
281884...

result:

ok 100000 numbers

Test #51:

score: 0
Accepted
time: 256ms
memory: 79100kb

input:

100000
32343 48696
69192 48696
49767 69192
49767 8340
8340 77973
77973 24477
26912 24477
26912 63887
66274 63887
66274 91721
33158 91721
33158 25990
25990 96674
96674 21445
39558 21445
80535 39558
80535 77602
77602 80110
80110 47079
35116 47079
35116 2698
2698 13634
13634 50258
43810 50258
53321 438...

output:

0
2
23400
23401
45922
45923
45924
45925
48238
48239
66632
66633
71181
71182
71183
71184
71185
71186
73287
93908
93909
93910
93911
93912
93913
109186
118676
137218
137219
137220
137221
148441
148442
148443
148444
148445
148446
148447
148448
148449
167082
167083
167084
167085
167086
179260
183086
1830...

result:

ok 100000 numbers

Test #52:

score: 0
Accepted
time: 257ms
memory: 78840kb

input:

100000
79812 51503
51503 90960
8539 90960
8539 59902
47264 59902
59209 47264
59209 85078
71997 85078
49140 71997
44382 49140
44382 30884
30884 9255
9255 55076
55076 24212
64534 24212
65357 64534
7814 65357
85524 7814
85524 46109
25313 46109
22619 25313
53619 22619
53619 33375
65357 64515
82920 33375...

output:

0
716
14572
15288
15289
17838
17838
18296
35996
36454
36455
36456
36457
59135
70310
70311
70312
80609
80610
80611
80612
80613
95131
95132
95133
95134
95135
95136
105343
105344
105345
122814
122815
122816
122817
126438
126439
126440
126441
126442
126443
145879
168402
190164
190165
191001
191002
19363...

result:

ok 100000 numbers

Test #53:

score: 0
Accepted
time: 541ms
memory: 88616kb

input:

100000
71321 3111
71321 76328
76328 64082
64082 64199
2972 64199
56000 2972
50160 56000
66340 50160
66340 46628
70382 46628
79571 70382
79571 80971
80971 67533
94341 67533
94341 58105
4219 58105
49744 4219
93409 49744
37143 93409
12149 37143
18841 12149
18841 31657
31657 50995
50963 50995
50963 2779...

output:

0
22677
26635
29681
35173
57829
79050
101706
123450
145194
154386
171550
179522
187494
201769
224139
228675
245839
253811
280819
296209
313373
317371
328751
344078
361242
369214
400600
408572
416544
420369
428341
430178
432015
456705
461170
463007
464844
481757
483594
483595
488825
513300
551733
553...

result:

ok 100000 numbers

Test #54:

score: 0
Accepted
time: 544ms
memory: 89044kb

input:

100000
83648 58186
45004 58186
13574 45004
18836 13574
40396 18836
61531 40396
61531 87939
27827 87939
60645 27827
44745 60645
73661 44745
73661 47749
48094 47749
48094 7140
97838 7140
97838 48695
48695 20180
20180 52931
72 52931
64330 72
58695 64330
16623 58695
16623 20736
19936 20736
59194 19936
1...

output:

0
2
3
4
5
33028
57490
57491
81473
81474
81475
81476
81477
104039
104040
104041
104042
132601
171086
180780
180781
180782
208309
208310
210879
210880
215320
257491
257492
286371
325729
366982
369826
369827
370113
404127
404128
425567
425568
430011
457534
495191
495192
495193
523653
523654
523655
5683...

result:

ok 100000 numbers

Test #55:

score: 0
Accepted
time: 560ms
memory: 90140kb

input:

100000
29439 28256
29439 90156
90156 38245
3068 38245
3068 32675
32675 32168
32168 64671
28600 64671
90750 28600
90750 17323
17323 98862
98862 47074
36119 47074
36119 69062
82747 69062
82747 52360
52360 4349
4349 29010
52288 29010
52288 78125
78125 55123
55123 71689
71689 84550
84550 94000
66374 940...

output:

0
2142
34232
66322
66323
66324
79921
81749
81750
81751
81752
110110
126840
167832
171683
173512
215524
217353
217354
217355
252738
252739
252740
263001
263002
289085
291001
291002
335398
379192
420311
422140
423419
443636
445465
446641
483990
497373
499290
501207
503036
504865
504866
504867
532679
5...

result:

ok 100000 numbers

Test #56:

score: 0
Accepted
time: 524ms
memory: 91216kb

input:

100000
45822 29369
90322 29369
90322 89923
89923 6692
6692 74186
74186 64820
64820 61515
30657 61515
30657 47919
47919 30836
30836 58731
58731 91949
91949 94806
16667 94806
16667 33327
68937 33327
68937 17057
17057 98031
98031 39991
26911 39991
26911 15957
3844 15957
60155 3844
60155 21064
23928 210...

output:

0
1853
1854
34333
73845
75698
75699
75700
75701
75702
75703
75704
75705
75706
75707
75708
75709
75710
75711
75712
111787
111788
111789
152434
152435
152436
152437
152438
152439
152440
188970
188971
238061
242348
284149
330893
335577
374608
374609
403247
430016
430017
469454
485170
485171
485172
4851...

result:

ok 100000 numbers

Test #57:

score: 0
Accepted
time: 523ms
memory: 91064kb

input:

100000
41556 40043
79290 41556
25185 79290
27262 25185
23187 27262
23187 81703
81703 24821
25185 96806
18610 24821
18417 18610
19721 18417
19721 42164
42164 29472
29472 83244
83244 99988
99988 10994
10994 86178
86178 24982
83871 24982
83871 83326
83326 88530
45863 88530
9919 45863
9919 60772
25994 6...

output:

0
1551
1551
21898
64285
106672
129504
152336
152337
152338
152339
152340
152341
152342
152343
152344
152345
152346
152347
152348
152349
183778
183779
227386
269768
269769
269770
279748
279749
279750
279751
283100
283101
283102
283103
283104
302470
302471
312261
312262
312263
326296
326297
332673
341...

result:

ok 100000 numbers

Test #58:

score: 0
Accepted
time: 785ms
memory: 99408kb

input:

100000
58261 49496
89298 49496
89298 74701
74701 52592
66011 52592
91764 66011
50779 91764
50779 73181
10069 73181
10069 14985
86885 14985
86885 5519
5519 42658
42658 74753
74086 74753
96587 74086
59362 96587
59362 2358
2358 18201
18201 18378
93767 18378
73384 93767
79775 73384
19248 79775
19248 638...

output:

0
61060
61060
91993
112413
129920
150660
165815
182640
183649
213573
235401
273927
290080
320004
326629
364389
394313
409819
410610
416541
431546
461470
483305
523721
546394
566173
596097
615706
641068
641068
656874
680867
691748
719169
740508
767267
774701
794845
815448
838747
862046
866049
889348
...

result:

ok 100000 numbers

Test #59:

score: 0
Accepted
time: 763ms
memory: 96236kb

input:

100000
74508 35216
60271 35216
60271 67783
91372 67783
40801 91372
11788 40801
40461 11788
62418 40461
62418 72760
25994 72760
25994 21149
47097 21149
60113 47097
60113 50778
82481 50778
82481 43616
70288 43616
70288 15517
88033 15517
99657 88033
99657 25536
76723 25536
50472 76723
50472 83053
48292...

output:

0
9668
28981
55995
55995
105011
142651
153025
180997
189264
196704
220888
240714
260540
296435
331203
331203
351679
371505
391331
394561
444739
464444
504245
523950
547032
556554
575940
595766
596160
622630
645259
665479
685699
730256
732369
752195
764699
784404
833909
853614
890268
898027
907933
92...

result:

ok 100000 numbers

Test #60:

score: 0
Accepted
time: 792ms
memory: 97788kb

input:

100000
69518 29885
69518 43226
16664 43226
61081 16664
61081 27900
27900 45820
60011 45820
60011 57865
57865 60904
60904 83582
91149 83582
91149 32250
32250 41300
93442 41300
93442 8190
20055 8190
26816 20055
52092 26816
52092 3976
3976 86065
629 86065
629 82040
30254 82040
8716 30254
8716 74516
745...

output:

0
24806
56164
57019
81825
97650
97650
110288
151899
176705
222138
255105
273878
322364
348025
367445
408729
436481
438894
462333
467750
493411
511449
556726
572494
596227
607254
623403
638014
674810
695573
700705
725511
747305
764364
791052
835750
860556
883804
923392
946640
988852
1006092
1014312
1...

result:

ok 100000 numbers

Test #61:

score: 0
Accepted
time: 811ms
memory: 96596kb

input:

100000
91376 10666
67572 91376
67572 88108
88108 17163
17163 77432
77432 29296
5769 29296
20346 5769
20346 38220
64566 38220
97866 64566
72081 97866
30741 72081
36222 30741
36222 32067
95997 32067
95997 76363
76363 22532
22532 68751
68955 68751
68955 61685
61685 93077
93077 4391
34745 4391
20346 778...

output:

0
1091
60387
65442
97826
152067
173924
225079
244459
265610
268087
327886
330363
332840
374560
396523
399000
433155
433155
458650
464966
502926
509242
558301
562674
563995
610410
636715
636715
659075
675803
680416
726624
748218
770075
783143
805000
846476
868333
902080
931158
953448
996626
1018916
1...

result:

ok 100000 numbers

Test #62:

score: 0
Accepted
time: 785ms
memory: 98120kb

input:

100000
58744 1044
9913 58744
9913 25403
25403 87702
80750 87702
80750 89567
89567 82538
82538 82892
82892 53001
53001 86175
86175 59438
59438 58771
3800 58771
3800 38727
70606 38727
70606 43975
43975 47711
7709 47711
99158 7709
71 99158
47611 71
12071 47611
63102 12071
63102 59667
44980 59667
33437 ...

output:

0
11344
14827
18310
18311
88347
88348
151174
151175
218007
218008
219368
242424
243785
252597
256614
287069
310882
373812
423589
442484
452280
453238
499640
499748
509921
564202
587341
597514
607687
635178
649998
684527
693488
721955
761271
762384
777211
799315
814142
820459
829752
842853
843254
885...

result:

ok 100000 numbers

Test #63:

score: 0
Accepted
time: 944ms
memory: 102360kb

input:

100000
48733 23468
23468 65923
78335 65923
78945 78335
55771 78945
55771 76169
22303 76169
36141 22303
36141 16339
16339 44567
74912 44567
74912 91731
60072 91731
8582 60072
23672 8582
23672 17810
28991 17810
65043 23672
1662 28991
14853 1662
14853 16224
50502 16224
50502 5991
5991 66746
45488 66746...

output:

0
17430
26073
44191
44927
52049
91798
96905
119965
143539
150637
189718
194297
238522
262636
293873
304890
309670
316865
319516
352760
370029
382390
419841
422855
458184
461058
497545
505106
529247
533135
564082
577007
613665
619586
639092
648844
688593
727404
772750
812499
823233
836809
869613
8788...

result:

ok 100000 numbers

Test #64:

score: 0
Accepted
time: 893ms
memory: 100916kb

input:

100000
76367 14475
78830 76367
78830 77760
25895 77760
73751 25895
72602 73751
53789 72602
53789 46242
46242 98333
18745 98333
18745 65582
10193 65582
10193 24946
24946 25791
76657 25791
76657 85174
81847 85174
81847 79196
79196 2756
29173 2756
44225 29173
44225 34158
34158 99456
28941 99456
28941 3...

output:

0
87628
87628
91764
98829
158836
160191
179902
200120
221609
276463
287759
327509
347813
402667
451970
451970
476334
476334
512887
533874
572154
594565
637000
637741
692400
723467
738412
756778
806269
806269
834198
868213
870215
890382
903101
923351
961613
997785
1043718
1071353
1078622
1096573
1108...

result:

ok 100000 numbers

Test #65:

score: 0
Accepted
time: 946ms
memory: 99620kb

input:

100000
73130 12919
73130 99846
4592 99846
76486 4592
46953 76486
46953 60242
60242 95104
95104 49128
49128 53385
78030 53385
78030 92569
68538 92569
40270 68538
40270 93253
93253 38073
2787 38073
2787 34172
34172 74633
16539 74633
16539 95479
95479 88587
88587 86690
86690 10237
94713 10237
14803 947...

output:

0
10177
12374
71131
81308
154915
192006
203706
238385
245056
246842
259738
278783
288189
290765
318094
353800
369792
386525
398803
402552
413189
443307
445457
462352
465612
469347
523169
536804
546464
587543
635700
638234
650630
699819
724131
724628
731791
760866
775631
803225
827534
828717
859757
8...

result:

ok 100000 numbers

Test #66:

score: 0
Accepted
time: 899ms
memory: 99408kb

input:

100000
35147 52751
80402 52751
132 80402
132 93556
93556 30132
52970 30132
52970 43111
43111 17256
17256 24929
24929 68569
68569 69422
69422 92767
63895 92767
27066 63895
34048 27066
32395 34048
32395 60897
60897 4965
30032 4965
30032 11312
30132 97301
11312 57733
72256 57733
72256 82765
82765 71316...

output:

0
38217
61282
66779
74466
113044
136150
174604
189681
206938
218673
246711
271769
289823
330555
330815
360514
381974
382078
388092
397552
426023
463551
477872
499311
516081
554711
581611
602095
647377
660390
667247
704942
735674
753969
800082
838597
848381
851409
866611
894371
903909
939869
967763
1...

result:

ok 100000 numbers

Test #67:

score: 0
Accepted
time: 887ms
memory: 101864kb

input:

100000
1852 78505
78505 85468
37489 85468
81107 37489
659 81107
659 61563
1104 61563
50250 1104
71996 50250
53551 71996
51682 53551
91300 51682
91300 89066
89066 90799
17918 90799
17918 93128
93128 88920
40504 88920
40504 15028
8758 15028
64816 8758
23941 64816
52872 23941
73956 52872
73956 28972
40...

output:

0
36057
70037
85368
129794
167198
184062
195934
210634
254651
296867
324673
324673
332016
359767
396959
427610
450071
461823
499297
504023
508875
517685
519038
534545
542487
554493
598857
635793
637625
687847
719798
747460
752737
762357
767718
817940
834491
846109
871940
873559
902848
929451
950964
...

result:

ok 100000 numbers

Test #68:

score: 0
Accepted
time: 889ms
memory: 102384kb

input:

100000
52201 30107
46722 30107
72597 30107
72597 13968
36320 72597
38458 36320
36320 82241
57303 82241
3791 82241
5341 3791
21747 3791
21747 30574
21747 37186
54425 37186
37186 87424
87424 31407
72471 87424
72471 51288
72471 75708
75708 8547
74793 75708
80780 74793
92782 74793
92782 93975
62578 9278...

output:

0
2294
4325
19129
54293
58867
81864
98698
99170
104403
111128
131359
131782
143623
162469
182313
189225
203260
206991
227932
254466
257031
264415
281460
300494
323408
343701
362101
369989
380486
408879
429180
430378
438635
448684
456216
459932
461665
488097
506435
516649
533263
544349
555405
570579
...

result:

ok 100000 numbers

Test #69:

score: 0
Accepted
time: 877ms
memory: 99276kb

input:

100000
99232 72694
1524 99232
74090 99232
74090 8537
74090 53789
53789 87689
53789 16597
16597 82927
16597 55604
55604 43697
55604 26611
26611 37978
26611 96368
6617 96368
98980 96368
98980 81677
16977 98980
16977 23398
45205 16977
65063 45205
36103 45205
36103 77725
62791 36103
24566 62791
62791 70...

output:

0
13601
35582
47538
58136
62148
65636
79360
79361
98383
101735
104044
121711
149922
156317
172550
177844
180783
183058
197178
199429
207747
213318
235827
253511
265392
270917
274257
281097
286953
292513
296867
307505
315262
330222
345922
360689
376411
387179
415130
431614
435348
451669
465680
485416...

result:

ok 100000 numbers

Test #70:

score: 0
Accepted
time: 891ms
memory: 99172kb

input:

100000
79798 52052
79798 90763
59494 79798
21856 59494
59494 45817
45817 53910
45817 29039
29039 93605
29039 79303
79303 33930
16474 79303
54194 16474
16474 3461
3461 23917
53951 3461
53951 76236
53951 2416
3863 2416
60945 2416
60945 44001
33771 60945
67060 33771
32706 33771
32706 19333
32706 84051
...

output:

0
2608
2608
27911
32146
65053
75708
114956
115633
136382
152005
168527
169752
178071
201133
237828
244298
253691
259309
266927
303144
305041
315206
317507
329303
348497
350905
351225
378165
382404
399293
430336
430337
433874
466069
476625
487520
507404
514005
538457
538594
556993
575761
594535
59453...

result:

ok 100000 numbers

Test #71:

score: 0
Accepted
time: 914ms
memory: 101976kb

input:

100000
92055 33893
92055 77535
95533 92055
52879 95533
98347 95533
98347 58276
13574 98347
23823 13574
13574 98918
98918 57477
98918 22421
22421 74561
22421 80964
64397 80964
44362 80964
44362 63535
44362 22914
22914 6428
41403 22914
17196 41403
3723 41403
3723 11577
1746 3723
1746 22342
1746 80902
...

output:

0
6440
17526
22922
36715
46983
60378
76606
100627
103520
130118
151098
157801
182172
198811
201951
210412
226570
233429
238961
252346
261748
270527
288986
298848
326480
329002
342306
348191
354194
368750
385751
415352
431180
442992
472237
489602
491649
494029
498369
514215
533726
551821
557752
57378...

result:

ok 100000 numbers

Test #72:

score: 0
Accepted
time: 906ms
memory: 101996kb

input:

100000
63523 47993
47993 21540
47993 44248
48746 44248
44248 52623
52623 84190
9414 52623
16162 9414
9414 59064
59064 97960
59064 14809
54960 14809
14809 93529
93529 31507
32407 93529
32407 16383
32407 15539
54115 15539
56189 15539
56189 67474
61470 56189
61470 17032
61470 64812
89403 64812
97478 64...

output:

0
17756
20175
20674
25559
46506
67413
68986
83243
98839
112502
132296
144034
161283
181775
195516
216811
235688
243146
264579
267011
287865
306640
312291
330552
332883
347130
353091
366759
380878
402055
419227
429905
440523
452402
455792
458148
463434
477353
481735
490233
503573
522679
540340
540341...

result:

ok 100000 numbers

Test #73:

score: 0
Accepted
time: 661ms
memory: 97236kb

input:

100000
20582 16263
89870 16263
67995 16263
67995 69846
69846 72404
67995 84250
13786 84250
8305 13786
8305 85404
91107 84250
91107 4411
4411 68848
68848 30446
30446 3127
91107 36629
70304 36629
70304 81785
73784 81785
73784 14506
98280 14506
36629 26533
26533 84511
84511 24793
3063 24793
84809 3063
...

output:

0
484
590
1068
1169
1232
1274
1528
1611
1715
1964
2151
2405
2673
2849
2935
3354
3768
3928
4352
4597
5001
5355
5628
6045
6161
6188
6479
6522
6887
6961
7131
7225
7429
7857
7885
8138
8379
8626
8868
9103
9299
9544
9805
10333
10412
10726
10981
11168
11427
11746
11903
11995
12290
12466
12721
12935
13094
1...

result:

ok 100000 numbers

Test #74:

score: 0
Accepted
time: 661ms
memory: 94328kb

input:

100000
54869 64919
2689 64919
54267 64919
69046 54267
58172 69046
88109 54267
88109 55981
55981 47766
6194 47766
8427 88109
8427 92326
92326 32504
26225 32504
26225 8645
8427 19057
19057 56519
18303 56519
18303 60251
60251 89888
3672 89888
19057 44662
57907 44662
60026 57907
60026 18420
18420 95628
...

output:

0
218
345
544
707
1022
1307
1388
1712
1992
2189
2483
2598
2951
2993
3292
3338
3544
3849
4153
4328
4503
4837
5083
5332
5483
5672
6015
6132
6449
6728
7051
7176
7609
7721
8117
8329
8464
8762
8951
9257
9545
9804
10098
10548
10864
11337
11503
11716
11888
12144
12229
12504
12720
13071
13220
13645
13719
13...

result:

ok 100000 numbers

Test #75:

score: 0
Accepted
time: 666ms
memory: 97576kb

input:

100000
64496 35362
64496 90717
64496 49163
49163 88492
43854 88492
87400 49163
97539 87400
82366 97539
82366 17980
87400 92276
13244 92276
13244 9581
73975 9581
49892 73975
92276 65930
65930 54323
54323 8717
8717 7738
7738 12707
12707 99969
65930 62378
13093 62378
13093 68721
25658 68721
25658 91709...

output:

0
272
617
1037
1233
1564
1590
2033
2217
2401
2566
2757
2980
3275
3662
3960
4123
4386
4575
4730
4862
5176
5387
5545
5777
6086
6292
6511
6743
7077
7184
7438
7474
7682
7977
8230
8524
8822
9223
9573
9825
10235
10420
10762
10900
11108
11375
11545
11573
11782
11925
12008
12160
12533
12965
13196
13235
1347...

result:

ok 100000 numbers

Test #76:

score: 0
Accepted
time: 704ms
memory: 99388kb

input:

100000
80211 26823
42551 80211
40166 80211
40166 25761
25761 55231
40166 19022
19022 29530
80187 29530
80187 96934
19022 51535
70766 51535
42156 70766
42156 63859
60790 63859
42747 51535
38416 42747
38416 19986
19986 48265
27094 48265
18859 27094
88172 42747
88172 11182
11182 84895
77636 84895
77636...

output:

0
550
579
913
1205
1276
1733
2007
2282
2383
2520
2863
3122
3273
3484
3782
3907
4058
4353
4618
4658
4729
4930
4992
5214
5406
5463
5771
5871
5966
6162
6273
6544
6788
7035
7291
7465
7513
7561
7901
8373
8643
9015
9133
9466
9634
9809
10032
10134
10477
10859
10924
11445
11719
11916
12229
12518
12722
12908...

result:

ok 100000 numbers

Test #77:

score: 0
Accepted
time: 696ms
memory: 99824kb

input:

100000
84525 19954
84525 82252
84525 69765
69765 39563
78060 39563
20535 69765
16462 20535
16462 32328
32328 37637
61709 20535
61709 72679
72679 40409
40409 71572
47354 71572
33603 61709
33603 2055
40749 2055
40749 6810
95884 6810
95884 90574
39303 33603
39303 74433
74433 25213
55904 25213
56137 559...

output:

0
416
518
655
842
1033
1121
1197
1403
1862
2018
2495
2727
2888
3120
3320
3470
3851
3993
4094
4171
4557
4687
4960
5189
5325
5666
5791
5941
6127
6321
6479
6516
6644
6844
7119
7518
7702
7963
7998
8338
8563
8869
9152
9405
9792
9985
10323
10443
11022
11212
11502
11908
12225
12265
12517
12620
12971
13258
...

result:

ok 100000 numbers

Test #78:

score: 0
Accepted
time: 364ms
memory: 97292kb

input:

100000
52323 75013
52323 37360
60316 75013
37360 41113
60316 11205
41113 48455
60316 45102
37360 96617
45102 21148
73653 52323
21531 21148
46286 21148
75013 74129
60316 26216
4561 21531
60316 52183
52183 1745
9707 52323
2121 4561
30904 96617
41113 89542
96617 79682
48455 94686
41798 26216
37429 2621...

output:

0
99808
99810
99808
99813
99808
99811
99808
99810
99808
99812
99808
99812
99808
99813
99808
99812
99808
99810
99808
99814
99808
99809
99808
99811
99808
99809
99808
99811
99808
99809
99808
99812
99808
99809
99808
99813
99808
99810
99808
99811
99808
99812
99808
99813
99808
99813
99808
99813
99808
9980...

result:

ok 100000 numbers

Test #79:

score: 0
Accepted
time: 383ms
memory: 97904kb

input:

100000
18868 71746
71746 62776
44995 62776
62776 40359
62776 78975
21557 18868
46711 78975
11171 71746
40359 84242
44995 70875
52483 46711
58489 40359
6739 70875
52483 31174
58489 55179
19108 58489
71746 72868
52483 919
84242 51081
84242 89972
919 62730
72868 49376
58759 58489
6739 17258
16867 40359...

output:

0
7
99815
199623
199625
199631
199634
299437
299439
399246
399252
499059
598865
598865
698673
698676
798483
898287
898291
898287
898289
898287
898291
898287
898293
898287
898290
898287
898289
898287
898293
898287
898290
898287
898293
898287
898293
898287
898296
898287
898289
898287
898294
898287
898...

result:

ok 100000 numbers

Test #80:

score: 0
Accepted
time: 381ms
memory: 97072kb

input:

100000
47574 19505
77771 47574
22441 47574
47574 52565
47574 65626
47574 74965
86546 19505
86546 65954
65626 65276
65954 141
35505 65954
65626 94437
77771 88658
50568 19505
8549 52565
57391 22441
52565 82771
23326 141
79502 88658
82771 33236
97539 141
8549 7480
85729 65626
39443 94437
141 989
23326 ...

output:

0
4
8
99817
199623
199627
299436
399243
399246
499050
499052
499054
499058
598866
598870
698674
698676
698680
698682
798490
798494
898297
998102
1097909
1197715
1197718
1297527
1297532
1297536
1397344
1397349
1397354
1397359
1397361
1397366
1497170
1596976
1596981
1696784
1696789
1796595
1896401
189...

result:

ok 100000 numbers

Test #81:

score: 0
Accepted
time: 369ms
memory: 100108kb

input:

100000
7408 91743
91743 13525
7408 59693
55831 91743
13525 46848
47597 46848
13525 29632
55831 14550
69194 13525
55831 37941
90432 47597
37941 13963
34291 55831
14550 56283
13963 81362
77087 69194
29632 15976
57718 13963
59693 50724
77087 17779
47597 54152
77087 92523
7408 5818
37941 54800
29632 394...

output:

0
6
9
99815
99817
99821
99824
199629
199633
299435
399239
499045
499049
598855
598857
698663
798468
798471
798479
798484
798488
898293
898296
998103
1097910
1197716
1297524
1297528
1397333
1397337
1497139
1596943
1596951
1596953
1596960
1696765
1796569
1796572
1896375
1896376
1896382
1896384
1996188...

result:

ok 100000 numbers

Test #82:

score: 0
Accepted
time: 361ms
memory: 101544kb

input:

100000
97978 76642
97978 77924
77924 67085
43583 77924
67085 12964
18153 97978
67888 97978
77924 85359
49778 67085
3429 77924
53743 3429
8699 53743
67888 33832
23431 85359
12863 67888
98403 85359
9656 53743
54158 43583
63754 9656
18153 47876
8699 67648
76442 85359
22803 12964
91179 98403
26771 98403...

output:

0
8
99814
199616
199619
299425
299430
399235
399239
499046
499049
598854
598858
698665
698672
798479
798481
798486
898292
998098
998102
998104
1097911
1097913
1197717
1297524
1297527
1397334
1397339
1397341
1497145
1497148
1497156
1497159
1497163
1497167
1497173
1596978
1696784
1696787
1796591
18963...

result:

ok 100000 numbers

Test #83:

score: 0
Accepted
time: 352ms
memory: 90592kb

input:

100000
48869 83660
48869 38270
38270 64746
12061 48869
38270 37852
54864 83660
51455 64746
13252 64746
40540 83660
83660 2710
40540 69576
51455 15269
67191 69576
65135 37852
80823 48869
95722 67191
51455 15320
49353 15269
77246 67191
12061 68752
64746 14616
37852 90103
37782 15320
80823 2626
54864 4...

output:

0
80018
80023
80018
80021
80018
80024
80018
80025
80018
80025
80018
80025
80018
80022
80018
80026
80018
80022
80018
80023
80018
80026
80018
80032
80018
80031
80018
80022
80018
80023
80018
80027
80018
80029
80018
80030
80018
80023
80018
80034
80018
80027
80018
80024
80018
80026
80018
80026
80018
8002...

result:

ok 100000 numbers

Test #84:

score: 0
Accepted
time: 350ms
memory: 93272kb

input:

100000
33152 66098
33152 59023
6037 59023
17925 33152
66098 65991
6562 59023
6562 5913
38079 59023
58063 6037
59023 89382
71619 65991
66897 58063
46114 33152
58063 93105
5913 56024
17925 9653
13450 46114
6562 3591
33152 44546
3591 19961
59023 83985
72897 6037
17925 8898
91100 89382
33152 16694
94361...

output:

0
80014
80025
160039
160049
160056
160068
160082
160091
240095
320106
320114
400123
480133
560138
560146
560151
560162
640172
720186
720195
800204
800212
800219
800224
800232
800239
880246
960256
960260
1040268
1120277
1200287
1200291
1200305
1200310
1200315
1200323
1280328
1360338
1360347
1360350
1...

result:

ok 100000 numbers

Test #85:

score: 0
Accepted
time: 357ms
memory: 94632kb

input:

100000
29309 29197
29197 74302
12974 74302
94195 12974
12974 13841
8761 12974
94195 84305
66654 84305
24190 74302
98617 29309
50160 74302
13841 83298
34631 24190
56036 84305
98617 88546
29859 13841
4514 94195
29309 62085
56036 84046
94529 29309
12974 28798
84305 36873
56318 28798
64651 29309
57430 7...

output:

0
25
32
47
50
63
80073
80086
160099
160110
240118
320128
400142
480149
480157
560166
560173
560183
640192
640205
720213
720219
800227
880241
960248
1040254
1040265
1120277
1120289
1200298
1200308
1280318
1280326
1280330
1360339
1440350
1440359
1520374
1520385
1600396
1600405
1680417
1680426
1760432
...

result:

ok 100000 numbers

Test #86:

score: 0
Accepted
time: 364ms
memory: 93148kb

input:

100000
17263 55732
40626 17263
14433 40626
33351 40626
92308 33351
17263 57899
92308 64825
92308 45813
40626 88398
54283 45813
64825 36171
22966 88398
57899 76272
2526 40626
49338 2526
57899 68285
76272 79216
33393 92308
36171 59524
59079 59524
8108 36171
1471 57899
67928 14433
38881 2526
52641 7627...

output:

0
20
80034
80044
160050
160060
160070
240082
240097
320112
400126
400138
480152
560160
560163
640173
640186
720198
720207
800216
800223
880232
880243
880246
880255
880266
960279
960283
960290
1040301
1040314
1120324
1200337
1200348
1280361
1280370
1280379
1280390
1360393
1360407
1360417
1360428
1360...

result:

ok 100000 numbers

Test #87:

score: 0
Accepted
time: 323ms
memory: 94720kb

input:

100000
34870 33641
16401 33641
34870 24477
49294 16401
62280 33641
49294 26552
24477 93005
16401 8229
37127 26552
46583 37127
5398 34870
26552 11424
27274 34870
2833 49294
46583 24115
91656 5398
24412 24477
34870 43398
24412 98753
11424 42750
91656 80845
16401 5754
66187 16401
3585 24412
24412 59043...

output:

0
80023
80029
80038
80046
160058
240073
240086
320093
320103
320110
320112
400121
480134
560142
640153
640163
720173
720181
720195
800207
800217
800222
800230
800243
880257
880261
880264
880273
880285
960291
960301
1040310
1040322
1120333
1120343
1200350
1200356
1200365
1280374
1280380
1280392
12804...

result:

ok 100000 numbers

Test #88:

score: 0
Accepted
time: 309ms
memory: 99712kb

input:

100000
19271 5646
19271 56539
68644 56539
31459 68644
66206 68644
5646 3156
19271 79843
19271 48442
57020 66206
5646 15928
19271 27113
82089 79843
57020 66146
19271 34917
82089 65463
46054 68644
3156 77405
5646 88709
93307 46054
6905 88709
19271 16843
92329 66206
57422 66146
92329 15290
42833 56539
...

output:

0
66476
99714
132952
99714
132957
99714
132954
99714
132950
99714
132950
99714
132954
99714
132953
99714
132949
99714
132951
99714
132952
99714
132954
99714
132950
99714
132952
99714
132953
99714
132953
99714
132951
99714
132951
99714
132952
99714
132952
99714
132950
99714
132953
99714
132954
99714
...

result:

ok 100000 numbers

Test #89:

score: 0
Accepted
time: 323ms
memory: 101000kb

input:

100000
42618 21865
18184 21865
18184 80942
34639 80942
21231 80942
21865 24510
32686 21865
21865 51267
74253 80942
89577 80942
18184 82558
42618 71439
21865 62702
80942 43806
6868 74253
24510 38479
69305 21231
82558 57779
68958 21865
44169 32686
18184 50481
22721 6868
42618 71917
82178 50481
21865 8...

output:

0
66475
66480
132951
166193
199428
232668
265907
299145
332384
365619
398859
432096
465336
498575
531812
565053
598292
631529
664766
698004
731242
764478
797718
830956
864197
897436
930673
897436
930673
897436
930674
897436
930672
897436
930677
897436
930674
897436
930676
897436
930678
897436
930672...

result:

ok 100000 numbers

Test #90:

score: 0
Accepted
time: 328ms
memory: 102948kb

input:

100000
25740 95653
95653 14075
25740 18085
25740 34668
71506 14075
14075 46756
14890 18085
22582 46756
97262 71506
34668 83777
90134 18085
15694 25740
14075 4295
16635 25740
23706 18085
15694 59140
87882 95653
97262 84178
64100 90134
71589 90134
56095 23706
28 22582
78851 64100
34668 83400
69643 180...

output:

0
6
66476
66479
132953
199424
199432
199438
265913
332386
365626
398868
432102
465340
498578
531816
565056
598298
631536
664774
698010
731249
764485
797725
830961
864199
897437
930676
963917
997155
1030393
1063631
1096870
1130110
1163350
1196587
1229823
1263060
1296300
1329540
1362777
1396016
142925...

result:

ok 100000 numbers

Test #91:

score: 0
Accepted
time: 299ms
memory: 98452kb

input:

100000
38709 10471
38709 14598
14598 78967
78967 8540
38709 78490
8540 53837
35014 14598
8540 79929
38709 32364
16951 78967
8540 72757
95912 53837
35014 10702
95100 10471
36090 16951
44316 78967
46478 8540
69444 79929
78967 40343
40343 431
36087 79929
16951 58240
58240 8315
15621 72757
77502 32364
8...

output:

0
66479
99717
132955
166193
199433
232672
265910
265915
265916
332390
398863
432100
465337
498573
531812
565050
598288
631530
664768
698006
731243
764484
797721
830961
864198
897433
930670
963908
997147
1030387
1063623
1096859
1130095
1163336
1196574
1229812
1263050
1296285
1329526
1362763
1396003
1...

result:

ok 100000 numbers

Test #92:

score: 0
Accepted
time: 285ms
memory: 101896kb

input:

100000
92314 52696
87381 52696
52696 54122
92314 66757
54849 52696
92314 71805
52696 16850
38379 66757
7056 71805
54122 85127
88934 92314
54849 85445
54122 76346
92314 35016
71769 52696
54849 77856
16850 74390
74390 46325
41208 38379
85445 59586
54122 63222
97268 54122
71805 11946
59586 13353
14856 ...

output:

0
6
66477
66483
66487
132959
132964
132968
132971
199442
199443
199444
265918
332389
332395
398869
465339
531811
598283
598287
664760
664765
731238
797708
830947
864183
897421
930658
963894
997128
1030366
1063602
1096841
1130076
1163314
1196552
1229787
1263024
1296262
1329499
1362738
1395976
1429211...

result:

ok 100000 numbers

Test #93:

score: 0
Accepted
time: 323ms
memory: 90260kb

input:

100000
29886 37855
73504 29886
71868 29886
71868 99990
22813 99990
73504 39002
60199 73504
40249 39002
93304 99990
74216 22813
9985 60199
37855 43065
62454 9985
25985 39002
40249 65730
48842 74216
9985 65920
85187 74216
22813 18511
87265 74216
29886 7978
29886 55841
85187 51356
71868 87788
25985 624...

output:

0
46685
70024
93367
70024
93361
70024
93365
70024
93364
70024
93370
70024
93369
70024
93369
70024
93368
70024
93369
70024
93367
70024
93366
70024
93366
70024
93365
70024
93365
70024
93363
70024
93368
70024
93364
70024
93366
70024
93368
70024
93366
70024
93369
70024
93370
70024
93367
70024
93366
7002...

result:

ok 100000 numbers

Test #94:

score: 0
Accepted
time: 319ms
memory: 90772kb

input:

100000
87362 97017
97017 59361
87362 27777
59361 81311
87362 18883
15148 87362
27777 38122
99989 81311
97017 67094
15144 38122
67094 73799
87362 90289
28266 81311
77326 90289
16571 77326
15144 15681
92096 28266
99989 73673
29777 38122
15681 91893
15681 49934
30867 81311
85965 28266
18883 57450
9560 ...

output:

0
46681
70020
93361
93374
140054
163395
186740
210077
233417
256760
280097
303442
326785
350137
373484
396823
420165
443512
466855
490197
513542
536888
560229
583573
606918
630259
653607
676946
700291
723636
746981
770319
793665
817005
840352
863698
887036
910382
933728
957071
980418
1003762
1027104...

result:

ok 100000 numbers

Test #95:

score: 0
Accepted
time: 317ms
memory: 88120kb

input:

100000
59077 11072
64489 11072
85864 59077
59077 11087
59077 33898
59077 79851
11727 33898
18641 59077
93894 18641
33898 50635
55453 79851
77906 18641
86008 59077
58515 11727
97333 11087
55453 36606
85864 1143
98359 11727
64711 85864
38487 58515
68468 18641
68468 8736
79851 96325
55453 32047
53518 3...

output:

0
19
46698
46707
93383
140061
163404
186748
210091
233433
256775
280121
303460
326804
350146
373492
396835
420178
443519
466865
490209
513553
536895
560235
583579
606921
630264
653604
676945
700289
723633
746978
770319
793662
817001
840348
863693
887040
910383
933731
957079
980417
1003758
1027101
10...

result:

ok 100000 numbers

Test #96:

score: 0
Accepted
time: 327ms
memory: 89236kb

input:

100000
54774 12831
12831 36044
36044 43887
54774 71986
75723 12831
36044 91952
31492 54774
31492 86648
31492 28426
76132 43887
93478 31492
80705 75723
40946 12831
91952 47889
44131 31492
80705 30507
80705 77424
93478 66790
91952 55943
71986 94270
38311 86648
31492 81297
54774 16199
7089 77424
43887 ...

output:

0
8
46683
93357
116704
140039
163384
186721
210061
233404
256747
280094
303444
326789
350135
373478
396822
420164
443505
466849
490197
513537
536883
560226
583571
606910
630249
653590
676937
700284
723628
746967
770316
793659
817002
840346
863689
887035
910373
933711
957050
980397
1003740
1027081
10...

result:

ok 100000 numbers

Test #97:

score: 0
Accepted
time: 296ms
memory: 92568kb

input:

100000
76422 65876
5720 76422
76422 39382
76422 58907
55383 39382
65876 76974
84757 55383
84757 93594
84475 55383
65876 85322
65876 17708
17708 82671
36171 84475
34522 84475
84475 20017
82204 39382
84974 20017
84757 71500
34522 86554
33092 86554
37189 93594
36171 62853
69009 55383
12117 86554
16011 ...

output:

0
19
46695
46707
93379
140057
140067
186747
210091
233435
256774
280118
280125
326802
350146
373486
396828
420168
443514
466854
490197
513540
536880
560226
583569
606914
630258
653602
676941
700286
723630
746974
770322
793663
817005
840348
863691
887034
910377
933724
957068
980409
1003751
1027097
10...

result:

ok 100000 numbers

Test #98:

score: 0
Accepted
time: 307ms
memory: 94684kb

input:

100000
34056 59890
33418 59890
75761 34056
59368 59890
21979 59890
90002 59890
34056 12090
30366 59368
59890 11847
59368 44218
33418 21143
13989 75761
90002 50606
82813 21979
26950 59890
59368 94237
59890 52297
80507 50606
37244 52297
49168 75761
44218 52261
50889 34056
11847 66804
84411 26950
21143...

output:

0
39808
59711
79619
99522
119428
99522
119425
99522
119428
99522
119427
99522
119425
99522
119430
99522
119429
99522
119429
99522
119429
99522
119429
99522
119425
99522
119429
99522
119428
99522
119425
99522
119424
99522
119427
99522
119427
99522
119426
99522
119428
99522
119428
99522
119426
99522
1...

result:

ok 100000 numbers

Test #99:

score: 0
Accepted
time: 310ms
memory: 95604kb

input:

100000
72857 76859
76859 67798
22935 76859
35482 67798
67798 78760
76109 35482
14223 67798
10182 76859
10182 18453
18453 27565
17298 10182
72857 97888
5626 72857
35482 89870
93494 17298
18453 74412
78760 62916
15074 74412
85920 15074
74412 44572
78760 36160
76091 44572
5626 857
35055 857
65890 44572...

output:

0
39806
59711
79620
99526
119433
139337
159242
179144
199048
218957
238862
258766
278670
298573
318480
338384
358287
378192
398095
418001
437905
457813
477717
497624
517526
537429
557333
577242
597146
617050
636953
656858
676764
696672
716582
736487
756391
776293
796198
816108
836011
855920
875824
8...

result:

ok 100000 numbers

Test #100:

score: 0
Accepted
time: 318ms
memory: 96440kb

input:

100000
89470 26175
3803 26175
26175 86787
4919 86787
89470 4560
28872 4560
19810 89470
28872 8106
89470 98298
4919 48873
3803 66708
18547 28872
28872 98205
24445 86787
81060 4919
89470 28408
59247 8106
89470 94502
98298 40772
38305 28408
89818 26175
89818 26749
98298 84635
28872 35795
24445 26518
96...

output:

0
39811
59723
79626
99537
119444
139347
159251
179159
199068
218974
238883
258792
278695
298600
318505
338409
358315
378222
398130
418037
437941
457845
477753
497661
517572
537477
557383
577290
597195
617098
637005
656909
676814
696720
716631
736533
756440
776345
796247
816151
836056
855963
875867
8...

result:

ok 100000 numbers

Test #101:

score: 0
Accepted
time: 287ms
memory: 92436kb

input:

100000
76189 72877
22016 72877
72877 58693
76189 36336
82067 72877
24466 22016
22016 60441
58693 8757
82067 13829
13829 37006
36124 72877
27655 36124
14895 58693
36124 86069
36336 74804
35940 24466
41780 36124
44648 41780
24466 58975
8757 786
74804 31023
21728 58975
68632 27655
70385 82067
91153 786...

output:

0
39806
59710
79613
79617
119421
139328
159235
179143
199046
218946
238851
258757
278661
298564
318470
338376
358279
378182
398090
417992
437897
457801
477708
497609
517518
537423
557326
577230
597136
617044
636950
656854
676759
696665
716571
736478
756384
776290
796195
816099
836003
855909
875816
8...

result:

ok 100000 numbers

Test #102:

score: 0
Accepted
time: 277ms
memory: 93212kb

input:

100000
22149 14920
22149 71855
14920 90974
90974 54217
90974 12873
71855 50502
37545 90974
60763 14920
41529 37545
86990 54217
60763 38275
55117 38275
20527 37545
23094 37545
20043 86990
20043 86130
37545 65124
41529 84133
12873 15632
55117 69847
99508 90974
82754 20043
65124 76794
23094 47791
99508...

output:

0
39816
59722
79627
99535
119441
139348
159252
179157
199062
218963
238870
258775
278678
298583
318488
338392
358299
378206
398107
418010
437918
457824
477727
497635
517538
537443
557348
577252
597153
617057
636967
656874
676780
696684
716592
736497
756404
776314
796219
816122
836027
855930
875834
8...

result:

ok 100000 numbers

Test #103:

score: 0
Accepted
time: 282ms
memory: 86808kb

input:

100000
85915 53917
85297 53917
85915 50141
53917 3490
84036 85297
50141 87750
53917 99403
85297 64126
3490 91779
88570 85297
9376 85915
50141 88179
9376 49184
15880 3490
38357 85297
3490 25254
92434 9376
92434 39778
88837 15880
88570 87744
59211 38357
75948 92434
78810 99403
45742 84036
72747 75948
...

output:

0
20018
30036
40046
50059
60067
50059
60069
50059
60068
50059
60072
50059
60074
50059
60068
50059
60069
50059
60071
50059
60069
50059
60070
50059
60069
50059
60064
50059
60074
50059
60070
50059
60067
50059
60078
50059
60068
50059
60067
50059
60069
50059
60068
50059
60073
50059
60069
50059
60065
5005...

result:

ok 100000 numbers

Test #104:

score: 0
Accepted
time: 305ms
memory: 85416kb

input:

100000
52383 98175
47188 98175
72398 98175
98175 35905
5234 52383
72398 30236
70864 47188
52383 33096
88262 70864
41433 98175
33096 58801
33096 25839
35621 35905
25839 17101
33096 88381
27019 5234
35905 72106
72106 62314
95255 88262
4774 58801
81031 98175
24602 70864
58801 6681
82383 41433
70864 324...

output:

0
13
20018
40025
40032
60045
70048
80063
90067
100076
110089
120103
130114
140121
150129
160141
170147
180163
190172
200181
210186
220196
230210
240217
250227
260241
270249
280253
290264
300275
310287
320294
330306
340318
350330
360340
370348
380356
390366
400376
410385
420395
430409
440417
450426
4...

result:

ok 100000 numbers

Test #105:

score: 0
Accepted
time: 297ms
memory: 86064kb

input:

100000
82887 78873
78873 22263
22263 2463
78873 73972
82887 79401
78873 20160
13408 2463
80478 79401
82887 40409
40409 95741
40409 62561
88439 73972
80439 79401
54283 13408
89029 88439
20160 90812
88439 10756
90812 65923
54986 20160
80439 94762
58094 20160
10479 13408
90812 72685
11386 78873
7981 65...

output:

0
20016
30026
40034
40043
40050
60057
60065
80074
100083
110092
120100
130106
140114
150130
160139
170151
180161
190170
200181
210191
220200
230212
240221
250229
260237
270246
280256
290265
300276
310285
320291
330298
340303
350312
360322
370330
380340
390347
400356
410364
420370
430378
440387
45039...

result:

ok 100000 numbers

Test #106:

score: 0
Accepted
time: 305ms
memory: 85640kb

input:

100000
30626 22529
22529 92944
30626 64940
64940 71591
92944 8011
22529 82425
8011 54594
64940 51242
69056 8011
25462 8011
30626 40893
51242 33116
5075 25462
25476 8011
30626 59021
25458 54594
16813 64940
92944 92722
75059 51242
59021 16756
52707 25476
18995 59021
51242 53382
54501 18995
25458 94721...

output:

0
20012
20025
40040
50050
60056
70068
80078
90091
100098
110109
120116
130127
140138
150142
160153
170157
180164
190178
200189
210199
220207
230213
240222
250238
260245
270257
280276
290285
300296
310309
320316
330322
340330
350342
360353
370369
380380
390389
400397
410402
420413
430424
440430
45044...

result:

ok 100000 numbers

Test #107:

score: 0
Accepted
time: 271ms
memory: 88628kb

input:

100000
68079 48140
45671 68079
68079 25413
45671 79153
9781 48140
27624 48140
45671 79465
48140 51925
45671 28928
9781 84158
78981 27624
22336 28928
79465 80225
28928 21616
73216 79153
79915 79153
79465 36405
57176 36405
34180 78981
68079 2800
57176 9691
37962 21616
84072 73216
18203 84072
28928 515...

output:

0
20016
20020
40030
50037
60044
70054
80062
90068
100078
110085
120093
130106
140116
150124
160133
170142
180148
190152
200163
210173
220180
230189
240199
250213
260220
270227
280240
290250
300257
310262
320272
330287
340299
350310
360316
370322
380328
390334
400340
410351
420362
430372
440382
45039...

result:

ok 100000 numbers

Test #108:

score: 0
Accepted
time: 0ms
memory: 28448kb

input:

1
1
+ 1

output:

0

result:

ok 1 number(s): "0"