QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#16828#2130. Fiolki 2 [A]qingaodong10 ✓2156ms69804kbC++203.0kb2021-12-23 10:38:212022-05-04 11:47:18

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-04 11:47:18]
  • 评测
  • 测评结果:10
  • 用时:2156ms
  • 内存:69804kb
  • [2021-12-23 10:38:21]
  • 提交

answer

// From apiad
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;

ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

typedef int i32;
typedef unsigned int u32;
typedef long long i64;
typedef unsigned long long u64;
typedef __int128_t i128;
typedef __uint128_t u128;

ll mod=1000000000000000003;

const int N=101000,K=55;
struct Mod64 {
	Mod64():n_(0) {}
	Mod64(u64 n):n_(init(n)) {}
	static u64 init(u64 w) { return reduce(u128(w) * r2); }
	static void set_mod(u64 m) {
		mod=m; assert(mod&1);
		inv=m; rep(i,0,5) inv*=2-inv*m;
		r2=-u128(m)%m;
	}
	static u64 reduce(u128 x) {
		u64 y=u64(x>>64)-u64((u128(u64(x)*inv)*mod)>>64);
		return ll(y)<0?y+mod:y;
	}
	Mod64& operator += (Mod64 rhs) { n_+=rhs.n_-mod; if (ll(n_)<0) n_+=mod; return *this; }
	Mod64 operator + (Mod64 rhs) const { return Mod64(*this)+=rhs; }
	Mod64& operator -= (Mod64 rhs) { n_-=rhs.n_; if (ll(n_)<0) n_+=mod; return *this; }
	Mod64 operator - (Mod64 rhs) const { return Mod64(*this)-=rhs; }
	Mod64& operator *= (Mod64 rhs) { n_=reduce(u128(n_)*rhs.n_); return *this; }
	Mod64 operator * (Mod64 rhs) const { return Mod64(*this)*=rhs; }
	u64 get() const { return reduce(n_); }
	static u64 mod,inv,r2;
	u64 n_;
}f[N][K],one,zero;
u64 Mod64::mod,Mod64::inv,Mod64::r2;

mt19937_64 mrand(chrono::high_resolution_clock::now().time_since_epoch().count());
ll rnd(ll x) { return mrand() % x;}
Mod64 powmod(Mod64 a,ll b) { Mod64 res=one; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a;a=a*a;}return res;}

int n,m,k,deg[N],pos[K],c[K];
Mod64 x[K],base[K][K];
ll ans[K];
VI e[N],rev[N];
int main() {
	Mod64::set_mod(mod);
	scanf("%d%d%d",&n,&m,&k);
	rep(i,0,m) {
		int u,v;
		scanf("%d%d",&u,&v);
		e[u].pb(v);
		rev[v].pb(u);
		deg[v]++;
	}
	one=Mod64(1);
	rep(i,1,k+1) {
		f[i][i-1]=one;
	}
	queue<int> q;
	rep(i,1,n+1) if (deg[i]==0) {
		q.push(i);
	}
	while (!q.empty()) {
		int u=q.front(); q.pop();
		for (auto v:e[u]) {
			--deg[v];
			if (deg[v]==0) {
				if (v>k) {
					for (auto w:rev[v]) {
						Mod64 coef(rnd(mod));
						rep(j,0,k) f[v][j]+=coef*f[w][j];
					}
				}
				q.push(v);
			}
		}
	}
	rep(j,0,k) pos[j]=n+1;
	per(i,k+1,n+1) {
		rep(j,0,k) x[j]=f[i][j];
		int p=i;
		per(j,0,k) {
			if (x[j].n_==0) continue;
			if (base[j][j].n_==0) {
				rep(l,0,j+1) base[j][l]=x[l]; pos[j]=p;
				break;
			} else {
				if (pos[j]>p) {
					swap(pos[j],p); rep(l,0,j+1) swap(base[j][l],x[l]);
				}
				Mod64 v=x[j]*powmod(base[j][j],mod-2);
				rep(l,0,j+1) x[l]-=base[j][l]*v;
			}
		}
		rep(j,0,k) c[j]=pos[j];
		sort(c,c+k);
		rep(j,0,k) ans[j+1]+=n+1-c[j];
		ans[0]+=n+1-i;
	}
	rep(i,0,k+1) printf("%lld\n",ans[i]-ans[i+1]);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 14ms
memory: 52388kb

input:

9 10 2
1 3
1 5
2 5
5 4
5 6
2 6
2 9
2 8
1 5
1 9

output:

1
9
18

result:

ok 3 lines

Test #2:

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

input:

2 1 1
1 2

output:

0
1

result:

ok 2 lines

Test #3:

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

input:

10 30 3
8 5
5 7
4 5
4 8
1 7
3 7
4 7
10 6
1 4
2 7
3 7
3 8
2 4
8 7
3 8
10 4
6 5
3 8
4 5
9 7
2 8
8 9
1 8
5 9
3 4
3 10
1 8
1 8
2 6
10 6

output:

0
7
6
15

result:

ok 4 lines

Test #4:

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

input:

11 10 10
4 11
7 11
1 11
2 11
6 11
8 11
7 11
6 11
3 11
6 11

output:

0
1
0
0
0
0
0
0
0
0
0

result:

ok 11 lines

Test #5:

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

input:

100 323 5
83 100
83 98
81 79
47 53
48 59
11 12
48 61
4 7
46 47
16 13
69 71
19 10
91 99
94 89
19 26
91 95
98 96
53 54
54 48
95 96
100 99
72 84
10 17
81 86
20 22
80 79
58 57
15 19
89 97
83 89
79 93
59 60
97 100
86 94
39 45
51 53
95 100
84 85
63 79
83 88
25 47
44 39
79 92
12 18
15 17
4 14
4 11
88 90
29...

output:

0
101
106
128
155
4070

result:

ok 6 lines

Test #6:

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

input:

100 498 10
11 41
7 18
21 37
11 86
13 83
6 13
14 55
12 21
21 83
11 68
13 26
18 57
13 84
14 20
19 38
16 73
11 43
7 14
8 80
20 50
11 75
13 21
10 13
9 14
4 12
14 15
21 95
11 69
11 72
14 11
21 81
18 95
21 62
21 30
19 27
16 51
20 98
18 29
13 36
8 94
18 79
11 77
14 26
21 28
8 56
18 35
20 91
11 18
4 11
20 4...

output:

0
90
89
88
87
86
85
84
83
103
3300

result:

ok 11 lines

Test #7:

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

input:

100 500 10
6 38
41 43
13 56
8 26
64 66
16 48
56 75
56 70
32 37
56 76
60 86
24 65
13 59
73 68
86 97
5 17
38 40
2 20
17 21
49 98
21 58
10 23
21 59
40 43
42 85
98 87
56 79
87 95
56 80
56 78
10 24
23 18
6 32
25 45
40 48
36 49
56 77
44 93
56 96
16 64
24 66
41 43
8 25
5 21
60 86
56 86
6 16
44 94
85 83
8 2...

output:

0
99
241
631
375
623
1396
730
0
0
0

result:

ok 11 lines

Test #8:

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

input:

98 500 10
31 16
76 79
70 80
47 24
54 32
32 33
30 31
57 47
47 34
70 46
93 66
42 14
57 62
19 22
94 58
47 23
77 82
71 72
5 34
93 66
57 60
86 94
47 30
35 25
94 87
49 50
23 21
35 25
60 49
53 76
97 95
31 16
93 66
88 89
2 98
1 57
1 90
24 26
67 65
98 85
55 54
83 64
30 28
94 91
47 24
59 48
77 82
60 61
98 43
...

output:

0
179
321
417
378
425
829
987
380
0
0

result:

ok 11 lines

Test #9:

score: 0
Accepted
time: 12ms
memory: 52484kb

input:

98 498 10
54 15
58 63
60 14
78 83
86 81
71 88
54 67
58 68
93 92
90 91
98 90
81 94
55 96
91 84
29 23
72 76
18 22
80 59
3 89
12 11
60 74
34 27
74 64
47 88
45 57
4 49
8 48
69 77
47 54
17 23
61 82
1 18
65 67
45 20
93 87
10 20
69 68
45 89
8 45
58 80
3 69
54 51
60 74
95 90
53 98
47 71
81 94
44 29
93 92
4 ...

output:

0
101
108
142
169
330
384
824
1858
0
0

result:

ok 11 lines

Test #10:

score: 0
Accepted
time: 1ms
memory: 52448kb

input:

98 499 9
73 87
59 95
50 91
32 31
43 36
73 70
42 30
34 11
39 95
51 20
59 60
3 47
66 56
95 94
7 60
52 58
32 40
14 72
43 40
63 62
42 26
4 42
63 50
36 29
4 67
7 65
71 11
58 48
57 54
90 87
71 75
63 53
61 62
7 59
31 30
76 94
51 39
42 39
36 37
30 20
14 74
66 54
31 27
44 48
33 74
12 19
63 57
67 63
25 78
31 ...

output:

0
89
88
87
86
96
284
3275
0
0

result:

ok 10 lines

Test #11:

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

input:

99 498 9
18 30
76 95
43 50
11 55
9 26
5 16
13 30
19 64
69 83
67 60
82 98
27 35
18 31
2 49
40 95
54 61
19 73
74 86
29 28
22 18
64 65
71 73
72 80
18 31
17 12
3 47
49 48
35 25
1 52
81 86
85 99
45 50
45 63
4 24
54 78
84 94
22 18
2 34
42 39
9 36
37 12
25 13
65 81
4 37
84 94
16 18
9 39
9 37
39 70
43 33
47...

output:

0
90
89
88
87
92
222
541
656
2230

result:

ok 10 lines

Test #12:

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

input:

100 498 10
42 48
56 51
5 74
6 48
8 77
55 56
65 64
68 11
92 95
74 80
65 64
29 46
42 46
89 87
88 85
32 59
92 97
38 29
7 49
32 40
55 56
30 20
74 80
13 30
30 20
62 70
30 20
15 44
77 71
75 82
29 46
72 86
13 42
94 93
64 37
81 12
64 12
23 42
65 63
77 84
89 100
89 92
99 67
94 93
13 45
2 70
30 21
74 75
72 86...

output:

0
108
140
186
168
197
439
361
966
1530
0

result:

ok 11 lines

Test #13:

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

input:

99 500 9
85 86
28 86
18 97
27 30
92 87
21 23
3 37
16 50
10 34
63 72
27 46
8 11
92 99
42 60
8 77
11 18
2 26
56 58
52 49
42 56
70 86
29 16
22 24
63 81
33 21
80 75
56 68
5 22
90 97
13 10
85 77
56 99
26 90
49 43
2 35
4 73
42 54
13 34
84 76
51 52
53 57
22 31
56 57
33 39
44 47
23 29
11 20
1 86
61 60
90 94...

output:

0
90
89
88
142
96
169
310
1304
1807

result:

ok 10 lines

Test #14:

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

input:

100 498 9
54 23
76 82
60 35
27 66
53 54
66 82
19 17
44 29
85 82
54 24
64 78
35 27
89 90
93 97
98 52
67 73
16 21
45 43
87 92
81 83
53 55
69 76
44 60
76 71
60 63
59 78
1 87
55 61
54 20
5 86
3 52
98 47
98 42
52 60
79 57
79 74
88 36
29 26
48 30
66 85
67 79
3 96
76 65
67 84
54 17
44 35
25 34
49 68
98 60
...

output:

0
91
90
89
89
91
545
1349
1842
0

result:

ok 10 lines

Test #15:

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

input:

100 500 9
55 43
31 85
45 76
69 83
39 14
3 100
3 100
33 35
39 11
98 62
27 16
9 32
50 87
75 70
53 82
35 36
50 89
4 92
75 70
94 95
5 98
99 95
93 92
64 67
2 94
37 21
3 56
67 55
40 39
4 92
50 90
86 87
84 16
64 67
28 22
20 22
53 82
52 53
60 51
38 41
14 26
60 89
31 85
6 94
34 27
3 61
31 29
44 49
13 19
3 61...

output:

0
485
1199
873
835
96
113
585
0
0

result:

ok 10 lines

Test #16:

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

input:

98 500 10
46 33
83 70
26 29
72 71
3 46
45 32
68 35
42 43
5 98
24 21
94 80
94 76
84 74
10 95
68 40
72 63
6 98
72 64
68 30
8 97
17 56
22 13
86 33
94 80
84 74
87 82
45 34
97 85
1 95
79 76
34 51
53 51
95 79
86 57
26 46
3 48
68 42
32 35
90 91
87 85
8 96
26 31
42 31
90 93
15 13
83 40
80 75
22 15
79 75
61 ...

output:

0
88
87
86
85
84
86
219
438
2743
0

result:

ok 11 lines

Test #17:

score: 0
Accepted
time: 20ms
memory: 52392kb

input:

98 499 10
1 38
1 33
16 47
45 50
5 83
83 78
67 92
4 51
33 40
2 71
1 19
86 76
4 42
9 43
83 73
44 56
32 84
29 86
17 14
3 41
43 92
59 66
11 15
82 79
19 35
1 27
1 19
42 54
1 12
60 53
10 47
45 47
8 35
10 42
38 63
1 33
45 48
30 88
16 57
17 11
9 83
40 93
18 25
19 29
35 36
65 66
1 38
19 28
1 12
29 89
83 74
4...

output:

0
91
110
125
122
240
286
316
360
866
1400

result:

ok 11 lines

Test #18:

score: 0
Accepted
time: 17ms
memory: 52436kb

input:

98 498 10
40 37
68 22
97 86
21 84
20 33
12 15
47 43
4 84
51 98
7 78
19 37
45 49
62 61
60 47
63 55
8 18
76 80
5 13
74 47
65 79
63 56
91 93
73 66
83 92
4 81
28 32
52 51
57 58
5 18
74 63
95 85
72 78
26 30
45 46
21 34
4 73
74 83
29 23
3 17
61 53
12 57
97 95
76 36
40 30
37 36
57 79
76 54
9 12
73 11
75 17...

output:

0
88
87
86
88
103
155
169
280
533
2327

result:

ok 11 lines

Test #19:

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

input:

100 500 9
28 38
23 100
74 71
19 57
93 59
81 94
56 61
7 17
17 46
8 40
8 54
71 59
17 23
32 49
86 93
61 65
45 27
3 72
19 92
17 49
13 50
79 80
51 95
25 27
23 42
19 63
23 39
19 67
100 84
20 16
99 54
8 46
13 46
7 20
48 78
99 64
70 65
28 37
8 60
20 41
78 90
12 33
99 58
3 72
79 66
1 25
13 47
16 91
32 49
16 ...

output:

0
95
107
150
196
250
569
189
337
2293

result:

ok 10 lines

Test #20:

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

input:

100 500 10
11 12
11 13
11 16
11 20
11 28
11 45
12 15
12 17
12 21
12 29
12 46
13 15
13 18
13 22
13 30
13 47
15 19
15 23
15 31
15 48
16 17
16 18
16 24
16 32
16 49
17 19
17 25
17 33
17 50
18 19
18 26
18 34
18 51
19 27
19 35
19 52
20 21
20 22
20 24
20 36
20 53
21 23
21 25
21 37
21 55
22 23
22 26
22 38
2...

output:

6
92
94
106
177
370
188
525
276
245
2016

result:

ok 11 lines

Subtask #2:

score: 1
Accepted

Test #21:

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

input:

300 1500 15
135 85
20 257
1 68
264 273
33 299
212 67
280 233
155 75
103 26
59 206
29 217
163 84
100 290
172 222
5 220
283 216
242 234
250 89
194 176
141 214
68 64
177 91
142 214
220 90
8 156
186 275
286 209
272 107
69 38
169 31
164 203
125 190
270 37
97 188
51 158
132 211
39 279
62 290
2 246
220 122...

output:

21
305
306
305
302
301
301
302
300
299
301
297
299
299
296
36521

result:

ok 16 lines

Test #22:

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

input:

299 1499 14
143 51
143 113
159 125
278 62
281 271
295 271
247 233
58 83
281 140
181 17
273 179
277 232
168 98
83 221
165 104
85 121
288 145
109 190
43 132
296 292
199 220
191 178
218 188
124 168
285 233
66 200
295 203
170 160
291 256
118 155
219 173
266 224
247 290
210 78
277 92
201 229
193 200
88 3...

output:

37
325
321
319
317
319
319
319
319
316
314
313
317
313
36587

result:

ok 15 lines

Test #23:

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

input:

298 1498 13
103 166
186 215
36 171
30 145
48 73
100 235
69 131
66 159
79 85
265 189
281 23
273 76
123 215
160 286
202 80
205 71
143 215
295 228
121 122
76 287
238 216
15 31
9 92
9 195
228 235
117 250
246 297
204 193
38 190
4 60
189 115
24 172
129 267
238 278
36 33
234 147
109 114
269 135
112 101
75 ...

output:

39
322
325
322
333
323
330
324
327
325
327
326
324
36808

result:

ok 14 lines

Test #24:

score: 0
Accepted
time: 16ms
memory: 52260kb

input:

300 1475 15
52 66
51 44
65 61
37 34
4 36
47 40
54 65
63 58
37 40
40 41
60 59
139 132
290 297
4 32
8 67
12 40
24 46
1 18
9 47
290 300
45 67
38 61
187 186
12 44
249 253
36 45
65 62
58 70
300 298
20 21
289 296
42 67
275 295
9 39
8 30
76 79
158 165
54 45
128 141
8 47
236 256
11 16
21 28
56 61
23 25
12 2...

output:

0
298
311
320
336
365
399
431
469
487
544
619
894
928
1586
32768

result:

ok 16 lines

Test #25:

score: 0
Accepted
time: 10ms
memory: 52288kb

input:

300 1499 15
12 17
24 30
1 162
33 297
58 185
62 115
1 230
62 75
1 57
64 196
64 134
25 38
25 48
27 21
48 63
58 142
42 50
40 44
31 45
33 277
41 44
64 167
1 228
33 202
12 19
1 23
23 34
33 147
5 32
38 50
7 27
1 144
52 57
33 86
33 189
1 38
1 102
33 289
56 209
1 127
56 142
2 19
33 265
21 41
41 33
62 134
25...

output:

3
288
288
287
286
288
288
317
325
348
510
995
1106
1569
3816
30041

result:

ok 16 lines

Test #26:

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

input:

300 1500 15
34 67
199 226
13 39
147 198
178 179
85 125
149 146
141 128
105 152
5 42
278 271
193 195
284 285
34 87
126 166
40 78
25 95
6 44
147 207
34 65
139 200
34 52
7 25
108 111
194 234
61 77
85 137
131 133
34 96
4 54
80 120
103 133
187 250
221 220
122 175
142 138
35 43
74 76
157 202
34 58
135 169...

output:

0
294
355
707
7029
2583
10988
6347
2188
579
515
2716
5224
1230
0
0

result:

ok 16 lines

Test #27:

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

input:

299 1500 14
11 42
113 107
97 86
1 227
271 277
3 296
239 241
1 253
12 32
218 208
148 165
12 184
259 276
144 143
156 263
44 64
151 167
222 221
162 274
1 230
162 259
88 95
49 101
249 248
148 163
227 240
12 141
161 174
81 87
197 199
297 273
244 54
281 279
68 76
49 101
9 267
68 77
9 150
256 295
136 133
5...

output:

0
289
297
308
338
524
663
1284
1846
6164
1403
3199
1875
22565
0

result:

ok 15 lines

Test #28:

score: 0
Accepted
time: 16ms
memory: 52396kb

input:

300 1499 15
250 222
32 261
37 46
296 294
191 192
11 146
130 151
220 222
113 88
11 131
11 138
141 104
237 232
106 99
4 283
207 53
250 248
21 27
62 37
148 127
208 209
32 262
278 222
95 101
189 205
52 294
42 43
259 282
6 73
297 279
266 260
6 54
220 223
64 42
77 78
277 276
11 132
162 69
200 47
73 77
141...

output:

0
320
358
450
647
597
1487
2792
1919
5410
16543
10232
0
0
0
0

result:

ok 16 lines

Test #29:

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

input:

298 1498 15
32 37
7 292
82 107
243 208
224 158
184 194
8 265
183 184
241 25
126 148
36 41
108 142
8 291
235 84
289 293
170 98
3 294
21 45
228 205
113 127
119 138
230 203
81 101
138 21
52 36
14 298
184 200
263 262
201 173
4 109
92 90
297 205
116 120
32 43
184 54
69 45
298 280
297 264
57 56
293 292
11...

output:

0
283
282
281
280
279
279
279
281
284
285
458
787
3484
4037
28607

result:

ok 16 lines

Test #30:

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

input:

299 1500 13
36 77
194 230
155 154
276 259
75 73
294 280
238 244
189 197
139 155
67 177
190 200
293 288
276 260
248 251
243 275
158 148
87 101
37 105
81 92
164 160
58 163
95 94
216 261
269 258
234 233
128 278
174 145
179 174
191 294
117 118
105 102
293 289
270 253
136 158
56 57
46 28
190 274
158 157
...

output:

0
286
285
284
284
329
410
404
509
471
3033
11442
3614
19690

result:

ok 14 lines

Test #31:

score: 0
Accepted
time: 1ms
memory: 52412kb

input:

300 1500 15
178 185
243 251
148 182
236 237
157 245
42 34
243 300
76 18
139 135
111 108
24 41
47 38
73 26
227 219
157 105
292 257
227 228
74 78
249 283
300 256
174 161
143 103
292 258
176 222
95 134
251 268
50 46
127 124
73 26
225 220
216 161
70 71
272 288
273 65
171 206
113 137
271 294
87 147
114 1...

output:

0
297
318
314
312
333
532
572
1255
1655
3255
7216
14730
3576
6390
0

result:

ok 16 lines

Test #32:

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

input:

298 1500 13
67 51
298 296
244 261
119 125
257 258
244 249
161 139
211 169
158 160
170 129
185 183
67 23
245 178
112 101
74 58
233 227
17 25
167 133
155 145
185 88
222 24
203 199
116 18
87 21
87 62
197 213
11 278
282 88
181 93
114 108
18 41
258 105
276 217
298 295
246 253
284 223
173 188
76 74
176 17...

output:

0
285
284
283
282
281
284
324
389
582
1479
4467
31815
0

result:

ok 14 lines

Test #33:

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

input:

299 1500 15
131 74
102 106
40 153
8 129
26 20
107 193
185 199
250 255
4 66
62 57
298 281
120 124
71 69
196 194
196 200
204 217
114 152
119 112
17 160
8 45
164 90
250 294
137 265
269 286
299 283
228 227
298 278
97 133
238 253
116 191
94 150
295 279
299 294
189 232
61 194
91 97
229 228
53 29
255 291
2...

output:

0
284
283
282
281
280
280
279
279
288
320
960
3771
1364
31519
0

result:

ok 16 lines

Test #34:

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

input:

299 1499 15
87 92
226 174
12 268
49 26
209 232
226 177
245 243
8 295
99 88
253 245
154 157
208 179
252 195
11 236
225 227
10 189
164 137
36 20
80 51
210 211
143 78
146 133
146 139
117 76
230 185
191 167
267 196
68 70
279 291
225 162
88 92
225 163
14 267
107 102
152 158
163 164
142 141
141 115
196 17...

output:

0
290
324
301
386
633
1169
1439
4702
2763
2351
24920
1192
0
0
0

result:

ok 16 lines

Test #35:

score: 0
Accepted
time: 15ms
memory: 52276kb

input:

299 1498 15
196 286
238 208
1 157
159 149
112 102
127 267
91 48
108 112
196 241
7 164
196 235
109 46
274 270
196 223
294 273
118 97
196 278
279 280
282 287
60 72
57 185
73 94
151 166
3 156
151 154
138 62
247 233
14 205
33 30
151 172
1 145
66 74
113 80
89 87
196 255
183 195
41 232
209 268
60 70
188 2...

output:

0
284
283
282
281
280
279
278
277
276
280
340
482
36848
0
0

result:

ok 16 lines

Test #36:

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

input:

299 1499 15
4 221
191 179
1 216
129 125
197 207
48 45
78 129
283 298
222 225
289 196
74 35
283 273
62 27
79 133
12 66
77 96
290 219
3 125
288 157
126 214
15 212
166 169
171 215
9 81
248 242
129 94
201 202
137 146
9 174
279 262
290 221
8 233
15 203
253 274
296 80
85 144
70 37
248 232
125 127
22 16
69...

output:

0
284
283
282
281
280
282
308
316
436
859
1373
1672
4058
5696
24060

result:

ok 16 lines

Test #37:

score: 0
Accepted
time: 21ms
memory: 52468kb

input:

299 1500 15
278 268
71 39
87 103
232 221
132 136
35 199
250 145
15 51
75 133
108 101
15 202
233 218
102 103
233 255
208 154
90 108
57 50
235 243
41 222
156 276
156 157
203 214
45 47
288 297
169 177
197 222
82 80
4 21
111 127
47 31
276 291
121 110
48 37
43 31
87 98
204 218
124 127
227 213
62 48
227 2...

output:

0
284
283
282
281
280
279
278
279
305
380
699
2044
1299
6102
27395

result:

ok 16 lines

Test #38:

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

input:

299 1500 15
92 164
288 243
4 92
282 252
15 56
207 64
170 177
270 220
277 282
296 185
5 277
8 246
287 55
278 269
207 57
13 259
10 295
293 173
131 174
234 243
275 271
15 218
7 272
12 274
293 171
275 270
3 133
15 83
29 17
131 166
282 298
215 187
270 250
232 57
1 296
272 281
276 119
296 138
113 119
128 ...

output:

0
284
283
282
283
282
287
282
417
399
960
1031
2557
4549
15929
12645

result:

ok 16 lines

Test #39:

score: 0
Accepted
time: 12ms
memory: 52452kb

input:

300 1500 15
18 23
18 28
18 30
18 34
18 57
18 86
18 155
23 29
23 31
23 36
23 59
23 90
23 156
28 29
28 32
28 42
28 60
28 96
28 157
29 33
29 46
29 61
29 97
29 159
30 31
30 32
30 47
30 62
30 98
30 160
31 33
31 50
31 63
31 100
31 161
32 33
32 55
32 66
32 101
32 162
33 56
33 67
33 102
33 170
34 36
34 42
3...

output:

39
288
287
295
302
317
328
362
485
725
1243
1408
2668
3664
9167
19177

result:

ok 16 lines

Subtask #3:

score: 1
Accepted

Test #40:

score: 1
Accepted
time: 29ms
memory: 52668kb

input:

5000 15000 50
1181 1258
4643 84
55 2696
1551 4754
288 991
2926 858
4303 1448
4880 1475
1042 349
3042 628
1375 2853
1365 997
47 4335
2585 1715
4225 1987
867 1285
2144 1193
325 4578
3600 1356
3528 1711
4851 858
3205 2373
3500 801
2499 922
4780 506
587 3251
1730 664
127 2551
4346 656
3538 2694
1065 503...

output:

5460
10468
10883
10842
10824
10628
11064
10865
11155
11073
11403
11061
11470
11374
11656
11606
11859
11470
12059
12124
12165
12293
12421
12800
12682
13286
13296
13667
14122
13883
15000
15381
15503
16694
17447
18892
20811
20640
24103
28169
33097
44264
68857
96130
151977
266536
469461
660476
1925834
5...

result:

ok 51 lines

Test #41:

score: 0
Accepted
time: 33ms
memory: 52568kb

input:

4999 14999 49
3704 3958
1813 2120
2270 4073
1057 2282
4808 495
4849 1701
3461 1940
2551 3243
2647 118
1677 492
2514 4168
990 1048
4456 2279
470 1727
2459 1439
2681 3786
4141 1787
700 1202
4425 1604
3685 849
4782 587
585 3697
3508 1225
4940 1357
1404 1041
4694 2713
3228 2196
3243 3367
1388 1843
2742 ...

output:

4285
9444
9182
9241
9298
9374
9441
9351
9712
9622
9456
9820
9716
9692
9822
9901
9979
9833
10185
10220
10421
10564
10423
10551
10499
10734
10916
11128
11007
11301
11691
11456
11709
11886
12575
12678
13161
13708
14428
15921
17992
21056
31681
46777
82075
136925
231675
342182
1129400
9789631

result:

ok 50 lines

Test #42:

score: 0
Accepted
time: 32ms
memory: 52500kb

input:

4998 14998 48
484 2331
3610 1781
757 799
3160 3901
3179 3153
2126 2451
4500 1700
2996 4330
2461 4293
4778 4896
3017 1884
1862 1311
711 812
2954 166
1108 1455
3581 2558
808 4364
165 4809
787 2389
3937 4972
4933 3458
2461 3931
2741 122
4347 261
1992 272
2968 190
619 2130
739 586
139 1586
3437 1590
381...

output:

4026
8943
8987
8921
9072
8956
8909
9012
9000
9033
9042
9215
9258
9285
9336
9296
9399
9394
9536
9639
9688
9556
9864
9625
9930
9933
10077
10000
10269
10349
10556
10691
10978
10753
11415
11643
13656
14551
15986
23263
35423
60577
80977
129407
180182
290154
451439
1067475
9547049

result:

ok 49 lines

Test #43:

score: 0
Accepted
time: 59ms
memory: 52708kb

input:

4950 14700 50
807 858
4853 4862
4938 4942
54 127
19 79
10 91
36 59
4740 4750
4913 4912
4896 4920
4667 4709
1108 1190
4888 4901
4781 4794
4904 4921
4886 4911
60 87
2028 2066
4909 4947
4820 4855
4908 4934
35 106
2778 2786
2887 2912
2119 2124
2273 2309
61 128
4858 4863
4852 4862
102 126
4172 4316
2153 ...

output:

0
4978
5057
5177
5295
5398
5487
5623
5757
5887
6005
6196
6378
6490
6739
6861
7078
7347
7540
7839
7922
8351
8544
8939
9384
9587
9811
10281
10891
11471
12097
12327
13436
13545
14592
15420
16955
18567
19441
22343
24101
25987
30304
34192
40399
50678
58897
74625
118871
199851
10978509

result:

ok 51 lines

Test #44:

score: 0
Accepted
time: 27ms
memory: 52632kb

input:

5000 14998 50
62 87
18 65
114 1396
85 100
92 1484
92 4283
57 124
42 2105
114 1643
115 450
124 135
31 69
1 68
2 3038
24 108
2 2939
10 67
73 81
114 1475
80 79
2 1553
88 125
114 598
35 52
7 893
92 2724
114 298
92 1426
101 2247
38 63
114 1155
2 1415
114 1714
111 87
114 3488
114 3594
117 2711
123 3370
88...

output:

204
5258
5378
5705
6583
8140
10648
14500
19255
26493
36219
45867
59729
66635
76157
94923
110168
127237
141748
123370
151043
156173
172815
188390
181320
211486
200087
226262
204225
290773
258052
223237
238101
269253
273038
263198
280559
317134
343459
306918
431033
347868
373853
447139
408230
471590
4...

result:

ok 51 lines

Test #45:

score: 0
Accepted
time: 15ms
memory: 52488kb

input:

5000 9999 50
79 75
78 1790
16 52
60 131
1 2771
1 964
131 104
1 3840
94 125
1 1571
88 97
135 124
105 109
109 1008
2 65
113 124
2 2853
12 77
1 1361
68 71
78 2538
30 58
51 111
16 77
1 2214
72 85
2 3192
88 123
7 1884
81 72
78 1097
74 134
3 849
82 114
1 3657
20 56
2 4489
1 4475
3 2239
1 2779
2 4510
2 295...

output:

1177
7085
9451
14042
22579
33693
56191
85210
114941
112131
146400
143156
155288
201977
210792
183586
257794
262802
242224
252309
259178
256636
288825
262855
311475
290586
241925
290875
315447
311861
279757
243310
357425
232649
304323
270327
329034
240546
408812
231069
245038
220324
361086
375004
332...

result:

ok 51 lines

Test #46:

score: 0
Accepted
time: 17ms
memory: 52636kb

input:

5000 15000 50
264 296
110 116
2810 2815
39 482
2238 2236
664 657
4571 4574
4861 4865
1553 1549
3072 3071
2817 2819
2507 2519
3333 3670
35 306
1857 2204
1236 1250
3498 3501
853 1121
3251 3253
991 1002
1829 1835
1654 1648
4387 4650
3193 3197
1679 1661
3295 3299
1762 2078
22 232
1365 1991
3869 3887
364...

output:

0
5734
11021
20474
32387
52074
106788
1407646
587062
176883
416264
836525
1643149
860869
1953582
64908
293328
1554955
352635
45711
36755
280030
53942
120909
286757
630875
422462
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 51 lines

Test #47:

score: 0
Accepted
time: 64ms
memory: 52488kb

input:

5000 15000 50
3180 3163
1756 1701
3297 3304
632 772
743 707
1099 1102
19 4601
478 386
1292 1786
4044 3426
1274 1827
780 764
1142 1603
4608 4562
579 352
3877 3912
1853 1905
3797 3770
36 1011
443 413
779 343
4034 3929
2887 2928
3483 3515
3098 3043
4828 4840
371 324
4387 4737
2479 2299
1937 2001
2280 2...

output:

0
4950
4952
4954
4961
4972
4986
4994
5011
5028
5045
5073
5088
5115
5151
5209
5261
5345
5463
5651
5752
6033
6269
6658
7175
10460
8753
11460
12515
31520
28424
32301
29205
81814
44627
44696
141396
106321
180841
248324
425044
152730
1281791
732576
13101
2416814
3229858
16826
58094
2785138
0

result:

ok 51 lines

Test #48:

score: 0
Accepted
time: 58ms
memory: 52616kb

input:

5000 14996 48
4099 3832
10 3758
1646 1355
4144 4032
2687 2522
246 483
3103 3165
1391 1396
3435 3402
4545 4562
1148 1640
1837 679
2426 2455
3177 3454
3898 3892
2620 2627
3396 2396
2636 2735
4019 4072
4314 4282
4400 4396
3286 3323
33 3822
2681 2903
3536 3503
823 933
4219 4247
4 2805
3885 2679
211 203
...

output:

0
4952
4952
4955
4959
4970
4980
5001
5019
5039
5071
5088
5129
5176
5221
5299
5359
5544
5661
5786
6262
6298
8761
8583
11612
10841
11011
14797
28733
33390
208057
167391
459999
64855
27106
35511
32308
50353
37909
443871
408438
117808
199836
287997
415006
916485
930042
7222207
0

result:

ok 49 lines

Test #49:

score: 0
Accepted
time: 71ms
memory: 52700kb

input:

4997 15000 50
4990 4929
4752 4746
2512 2485
1246 1266
1651 1608
4813 4773
3024 3025
434 521
3211 3217
1498 2872
806 966
2990 3023
2988 3049
1321 1323
1721 1708
660 226
4581 4463
2974 3024
2632 2541
3948 4279
1701 1672
4487 4410
1 2038
1014 1001
4096 4208
926 220
4937 4959
4096 4104
3802 3774
14 2159...

output:

0
4947
4948
4948
4955
4960
4964
4970
4979
4995
5006
5029
5044
5070
5090
5125
5150
5188
5223
5241
5300
5365
5417
5501
5604
5880
6022
6323
6644
7408
7705
8192
10694
15493
37547
32616
34733
48929
74640
56689
177747
23055
167830
171726
133246
50368
51556
423830
520699
316246
9720041

result:

ok 51 lines

Test #50:

score: 0
Accepted
time: 63ms
memory: 52560kb

input:

5000 14998 46
2060 1961
2924 2735
3170 3198
4046 4546
3388 3356
2287 2310
1519 1501
1169 910
265 247
41 4843
2707 2721
3283 3372
2379 2467
159 647
449 666
763 714
2255 2220
41 4876
91 205
2219 2628
2884 2886
1007 894
2446 2433
1919 1882
2916 2028
281 452
4526 4541
4137 4461
2128 2094
1083 1091
1278 ...

output:

0
4954
4953
4956
4957
4963
4979
4990
5001
5012
5028
5046
5070
5085
5104
5134
5165
5223
5265
5325
5431
5527
5667
5918
6327
7896
8765
11591
10901
11470
14090
85485
11188418
39878
11442
50009
383043
325467
0
0
0
0
0
0
0
0
0

result:

ok 47 lines

Test #51:

score: 0
Accepted
time: 45ms
memory: 52692kb

input:

4996 15000 46
2444 2474
4067 4068
3262 3562
3656 3713
442 307
225 271
1745 1787
3863 3864
41 4891
1836 3677
930 742
3714 4000
1520 1539
2428 2008
1541 1494
723 689
4934 4960
1966 1817
2335 2371
2355 2447
4030 4169
4683 4684
1074 1398
2669 1769
4212 779
3692 3666
2160 2158
3254 3488
4484 4643
1315 13...

output:

0
4950
4949
4949
4955
4958
4970
4980
5001
5016
5033
5067
5099
5130
5187
5245
5331
5516
5632
6155
6905
9674
13021
22824
15285
57623
49447
57145
158513
3414292
1663224
3760135
5866
5474
2375624
540550
0
0
0
0
0
0
0
0
0
0
0

result:

ok 47 lines

Test #52:

score: 0
Accepted
time: 73ms
memory: 52700kb

input:

4995 15000 50
4738 4730
1018 1006
244 413
8 343
4805 4814
2950 2976
2982 2976
4155 4207
3814 3808
1001 996
1986 2027
1729 2456
4994 4911
109 55
247 238
2483 2482
1843 1604
78 797
4406 4755
3505 3663
721 457
2457 2418
969 862
4650 4638
3856 3832
996 1136
2609 2911
4468 4501
2814 2775
4013 3989
3513 3...

output:

0
4945
4945
4944
4947
4954
4958
4965
4969
4974
4986
5000
5009
5018
5035
5054
5075
5086
5105
5144
5176
5207
5244
5289
5364
5418
5521
5606
5731
6005
7185
8589
8685
10434
13632
13708
16708
27326
41180
35739
75823
35458
185459
251720
1244430
699471
327610
8289199
786955
0
0

result:

ok 51 lines

Test #53:

score: 0
Accepted
time: 69ms
memory: 52256kb

input:

5000 14996 50
1802 1636
2946 3092
2616 2271
24 4835
2825 2818
4781 4661
1962 1926
1839 1673
4800 4618
3232 3247
1406 1528
34 4673
1719 1817
15 4749
2877 2977
127 242
3572 419
2889 2801
1914 510
4295 4265
1930 1718
4904 4685
4604 4606
4953 4878
433 130
2571 2573
1683 1705
3015 548
3901 3199
3046 3029...

output:

0
4950
4951
4950
4952
4960
4964
4970
4976
4978
4989
4995
5009
5016
5026
5041
5056
5083
5105
5125
5156
5200
5235
5283
5335
5430
5525
5767
6024
6188
6597
7199
12896
15415
16555
19256
16225
21360
37579
324111
122725
108163
71337
147295
149881
8026368
2723206
84072
76064
117182
0

result:

ok 51 lines

Test #54:

score: 0
Accepted
time: 47ms
memory: 52604kb

input:

5000 15000 45
3670 3647
3987 4748
3364 3340
3669 3330
1907 1847
3763 4931
4266 4260
3804 3786
521 306
1552 2444
3698 4870
2425 1810
2680 2679
3760 3909
822 1746
3477 3451
3298 3574
3993 3996
2204 2244
594 740
650 615
255 670
2204 2234
2841 2899
4207 4365
2661 2641
2010 2002
3764 3950
909 1276
3461 3...

output:

0
4955
4954
4957
4959
4970
4978
4988
5003
5009
5036
5061
5086
5124
5161
5202
5266
5325
5451
5596
5965
6521
7571
9780
11426
20653
27581
47547
56067
29685
161142
290726
291301
260334
602409
202955
4944345
857611
4347790
0
0
0
0
0
0
0

result:

ok 46 lines

Test #55:

score: 0
Accepted
time: 63ms
memory: 52704kb

input:

5000 14998 47
1726 788
216 243
2864 981
3917 3910
493 488
192 156
765 492
2817 2785
3259 3463
4558 4567
4328 3722
88 254
3575 3198
3125 3117
2758 2278
600 751
2152 2150
720 215
2448 2370
1060 1554
2851 2288
3761 2490
4112 4508
2893 2790
861 737
70 117
2651 2671
1539 1577
2782 2778
4757 4456
1791 186...

output:

0
4953
4953
4955
4958
4964
4970
4972
4988
4998
5009
5015
5026
5041
5062
5081
5124
5151
5191
5197
5234
5271
5324
5383
5441
5500
5665
5835
6075
6559
7101
8343
9592
27749
23268
124323
151967
40673
79423
302264
440820
6925100
3976063
0
0
0
0
0

result:

ok 48 lines

Test #56:

score: 0
Accepted
time: 64ms
memory: 52672kb

input:

5000 14999 50
4194 4302
2847 3204
2543 2422
2600 1842
2732 777
291 116
1722 1639
915 3452
1629 1684
2717 2548
3892 3905
2811 3934
2369 2022
4404 4527
4206 4342
2656 2647
2633 1534
18 1846
926 947
2643 2338
4563 4728
2630 1795
3 3638
1633 1616
1778 1533
3971 3615
3584 3582
2004 2005
2325 2158
293 79
...

output:

0
4950
4949
4949
4950
4950
4950
4953
4953
4955
4955
4958
4959
4965
4973
4975
4980
4986
4992
5005
5018
5035
5060
5074
5133
5225
5726
6349
21223
19691
9489
16034
16437
52040
37326
46270
63574
206985
546491
384175
57735
89909
383110
511913
255689
1461768
320200
1721400
2286315
3609024
0

result:

ok 51 lines

Test #57:

score: 0
Accepted
time: 55ms
memory: 52696kb

input:

4995 14995 48
599 1118
2361 2440
4312 3840
601 143
4563 1817
404 586
4053 4044
340 358
1660 2871
1402 973
2017 2014
4934 4918
4383 4256
3929 3959
575 518
216 279
4436 4423
3744 4203
676 161
2661 2646
1589 1643
1108 1128
4202 4209
4300 3664
3002 2999
3610 3041
625 731
3272 3618
4050 2921
3175 3233
61...

output:

0
4947
4949
4950
4950
4957
4961
4967
4973
4982
4994
5007
5022
5044
5053
5080
5108
5127
5152
5183
5225
5270
5320
5401
5637
5928
7012
8644
10494
10010
17919
23775
28629
71003
59603
145296
142056
196344
299894
176746
783675
1136085
3398561
5594945
0
0
0
0
0

result:

ok 49 lines

Test #58:

score: 0
Accepted
time: 78ms
memory: 52540kb

input:

4996 15000 50
4838 4959
4131 3974
1808 2420
204 130
3381 4257
594 614
671 660
4517 4387
2237 2003
3851 3727
4018 4017
2638 2659
25 288
3373 3959
3412 3563
263 2125
3563 3960
1808 2508
1926 2465
45 798
1984 2727
3660 3650
2166 2127
4325 4356
2930 2963
4479 3741
1885 1692
326 4672
2375 2388
4594 4210
...

output:

0
4946
4945
4946
4945
4945
4945
4947
4949
4949
4951
4953
4959
4962
4971
4981
4987
5000
5009
5020
5029
5054
5081
5101
5169
5240
5365
5679
5953
6685
6870
8467
10524
9893
10383
14261
20561
270906
351560
39439
32735
46218
91571
246627
715793
228024
2375924
804584
486198
6314727
0

result:

ok 51 lines

Test #59:

score: 0
Accepted
time: 22ms
memory: 52612kb

input:

5000 15000 50
53 55
53 58
53 68
53 90
53 115
53 200
53 379
53 743
53 1550
55 61
55 76
55 91
55 116
55 208
55 380
55 754
55 1551
58 61
58 77
58 97
58 125
58 225
58 381
58 778
58 1555
61 83
61 98
61 129
61 233
61 382
61 782
61 1558
68 76
68 77
68 102
68 131
68 234
68 390
68 788
68 1559
76 83
76 104
76...

output:

2005014
4955
4954
4958
4964
5050
5071
5307
5842
6782
7457
8484
9071
10230
17044
26531
13044
21618
17859
22593
18900
20169
25413
31322
34053
41169
41537
64563
60647
94348
79242
59403
69482
93994
109139
141165
137297
108696
135594
153923
103851
283683
179849
205962
84362
118231
174006
144919
666537
14...

result:

ok 51 lines

Subtask #4:

score: 1
Accepted

Test #60:

score: 1
Accepted
time: 887ms
memory: 67292kb

input:

50000 1000000 15
18880 16174
41509 31679
15076 47370
20331 45525
9011 10292
30074 3605
28537 9840
40932 12040
9966 39950
35297 36791
39932 38466
41304 6021
48553 3399
29042 25334
24827 41347
29537 37302
1233 15027
13100 2493
36854 26961
45936 13745
16541 43321
22862 34077
39416 3809
26911 8586
43697...

output:

5726
55737
55759
55751
55754
55823
55762
55780
55767
55794
55804
55842
55783
55809
55851
1248488363

result:

ok 16 lines

Test #61:

score: 0
Accepted
time: 362ms
memory: 58256kb

input:

49998 333333 13
12623 46144
32125 18535
46331 107
7634 18123
9199 7225
45828 7972
33997 2853
35188 25544
568 20461
38140 4260
4481 26553
27673 33629
38355 11389
49632 6793
37244 26535
2029 26049
15116 36496
41247 30189
47370 30848
16616 44686
246 49602
13216 28489
42066 28195
6384 36021
43851 24486
...

output:

34671
85009
85461
86237
85662
86407
86869
87001
87490
87980
88436
88618
89590
1248195674

result:

ok 14 lines

Test #62:

score: 0
Accepted
time: 639ms
memory: 62228kb

input:

50000 749775 15
48534 48562
46484 46487
35386 35394
12242 12250
33051 33069
6009 6071
34806 34808
10716 10721
31858 31876
24696 24692
15671 15705
3720 3716
40363 40373
28089 28103
25863 25871
27641 27665
21361 21376
19896 19915
25148 25159
17769 17798
9183 9261
12515 12498
5415 5422
30948 30946
1676...

output:

0
49985
49984
49983
49982
49981
49980
49979
49978
49977
49976
49975
49974
49973
49972
1248575406

result:

ok 16 lines

Test #63:

score: 0
Accepted
time: 199ms
memory: 54372kb

input:

50000 149992 15
240 37140
239 42985
239 48109
219 10879
239 13733
240 46021
232 25673
239 44118
240 41981
224 27942
232 10833
236 27659
239 18194
239 16613
239 31429
231 29994
208 38907
250 41496
239 18633
236 39944
239 11228
71 121
240 4330
239 13046
240 46589
217 24226
232 48718
232 19905
239 2404...

output:

850
51007
51286
51936
53236
56561
63486
79456
107888
156695
233674
365836
610734
1139566
2560151
1243692743

result:

ok 16 lines

Test #64:

score: 0
Accepted
time: 438ms
memory: 58248kb

input:

50000 499990 15
249 35902
247 1738
239 44122
241 18949
215 47404
247 1084
252 48059
180 8930
215 26623
252 5393
246 45674
216 46477
240 38620
216 9871
185 6970
227 6564
249 8639
180 41016
216 24435
246 36455
239 15109
241 29560
180 48986
215 36681
185 45340
241 35450
216 40444
227 25632
247 15887
25...

output:

0
49985
49984
49983
49982
49981
49980
49979
49978
49977
49976
49975
49974
49973
50028
1248575350

result:

ok 16 lines

Test #65:

score: 0
Accepted
time: 606ms
memory: 67688kb

input:

50000 1000000 15
436 441
17409 17441
38345 38356
10858 10919
44668 44796
30363 30432
8852 8867
25101 25125
9687 9699
18190 18318
17450 17437
24950 24960
29044 29081
36351 36460
23764 23814
17414 17407
12 3379
34048 34196
3134 3340
39416 39448
10537 10591
30348 39345
24696 24699
29363 29550
47357 475...

output:

0
2347833
15158209
23166554
432819197
56860045
355889598
149840679
73777677
17309927
91560184
30545202
0
0
0
0

result:

ok 16 lines

Test #66:

score: 0
Accepted
time: 514ms
memory: 66012kb

input:

49996 1000000 15
28985 28979
1438 1436
2581 2578
20134 20141
30260 30257
30966 30968
21867 21850
6112 6085
47235 47205
10173 10183
34129 34127
35586 35509
1297 1298
19556 19557
24766 24759
15369 15267
41029 41027
49491 49492
1127 1143
37465 37451
27155 27144
47169 47180
16942 16932
17868 17845
36067...

output:

0
11042931
14285179
36295966
24628596
15409498
20924835
70157711
50983290
16397317
114674773
99695986
197444209
577134880
0
0

result:

ok 16 lines

Test #67:

score: 0
Accepted
time: 697ms
memory: 66636kb

input:

49997 999996 15
23615 23622
27785 27778
49166 49165
2900 2898
10607 10601
28707 28779
3017 2988
18675 18630
13012 13007
24093 24142
3784 3769
25031 24997
23616 24059
8386 8384
5632 5635
47224 47220
41850 41838
48144 48160
38439 38384
23777 23747
41062 41050
5525 5508
22304 22305
1026 1252
40248 4034...

output:

0
50370
51392
54689
63972
101684
172471
496181
1258078
2992400
7735250
21805613
103465138
850780975
260096940
0

result:

ok 16 lines

Test #68:

score: 0
Accepted
time: 616ms
memory: 66208kb

input:

49999 999997 15
24784 22711
35477 35482
19367 19333
47336 47320
13572 13570
36804 37018
22564 22536
16885 16888
40883 40863
8596 8602
41446 41449
29515 29632
6155 6146
6378 6224
38879 38740
3205 3250
34131 34161
17972 17973
46296 46314
38777 38822
46481 46443
11472 11509
37403 37408
36463 36464
2829...

output:

0
625400
2912760
3817099
10642253
89914420
151066447
259409188
144431294
68271674
8143012
8643645
68008200
290079852
85742741
57517135

result:

ok 16 lines

Test #69:

score: 0
Accepted
time: 697ms
memory: 66592kb

input:

50000 999997 15
29500 29514
33348 33373
20655 33708
14923 14930
13001 13002
22708 22629
9498 9493
19433 19446
2158 2153
5106 5123
32929 32874
44531 44550
13518 13512
26442 26425
49281 49280
47819 47766
11116 10958
40473 40449
3330 3340
21510 21480
21271 21269
11124 11210
40726 40712
23178 23197
4826...

output:

0
51944
59372
73512
114621
410594
584590
5141717
9143427
11412410
397775407
78967840
32520252
212588396
49155710
451275313

result:

ok 16 lines

Test #70:

score: 0
Accepted
time: 621ms
memory: 66584kb

input:

50000 999995 15
38880 38869
9795 9239
18862 18844
2934 2925
20347 20360
11529 11534
21953 21954
14065 14085
30316 30318
31954 31881
33762 33763
29642 29689
26638 26623
37046 37051
467 494
27318 27308
14426 14422
17048 17145
40395 40379
36390 36382
46400 46305
42948 42974
11864 11910
22415 22405
4382...

output:

0
50354
50863
52857
57360
101527
186285
2002487
5395058
40828853
206706293
993843168
0
0
0
0

result:

ok 16 lines

Test #71:

score: 0
Accepted
time: 618ms
memory: 66612kb

input:

50000 999998 15
16362 16255
33833 33827
18564 18552
31675 31681
23072 22532
538 795
37834 37904
20368 20314
48560 48554
649 639
7060 7092
34078 34068
20424 20397
26646 26678
30181 30141
29674 29297
28916 28798
16395 16392
272 291
873 875
3881 4011
17725 17670
29474 29478
48208 48170
31924 31934
5084...

output:

0
50665
55534
71386
89836
154333
590396
2405178
18538825
17158082
107265246
1102895624
0
0
0
0

result:

ok 16 lines

Test #72:

score: 0
Accepted
time: 576ms
memory: 66140kb

input:

50000 1000000 15
35005 35012
6279 6270
16361 16328
10833 10830
22638 22657
40045 40042
38105 38100
27405 27442
31737 31739
26913 26912
10888 10890
3809 3789
37539 37527
852 859
46524 46542
12935 12937
23880 23887
44322 44299
31255 31288
44925 44936
13522 13500
2420 2358
10327 10324
30134 31680
23922...

output:

0
8510805
6875630
6750859
13760852
50594338
94899341
68260034
242286934
58995629
164598203
224644478
129513194
88691148
50605196
40288464

result:

ok 16 lines

Test #73:

score: 0
Accepted
time: 526ms
memory: 66152kb

input:

49995 1000000 15
35402 35408
22796 22801
34838 34819
35421 35436
24254 24240
45500 45509
46985 46999
26330 26336
14187 14188
7609 7588
46268 45989
19587 19577
38505 38457
11330 11362
49133 49193
14330 14331
7863 7780
48611 48615
48085 48083
29939 29943
2601 2613
17313 17314
8490 8482
42481 42493
353...

output:

0
6095809
18798295
29080186
16646028
39644349
44721266
74322869
96530256
372977239
169567237
91079419
262063592
27498645
0
0

result:

ok 16 lines

Test #74:

score: 0
Accepted
time: 372ms
memory: 65500kb

input:

16666 999997 13
14414 14439
760 737
14811 14810
5169 5154
12533 12545
2258 2251
11016 10984
2481 2485
16228 16295
7580 7578
11616 11677
8944 8893
6759 6688
7080 7081
12917 12935
12397 12376
12594 12455
11592 11569
7008 7001
9934 9904
15143 15151
4453 4437
13494 13511
64 16
9028 9024
8175 8165
4486 4...

output:

0
16653
16659
16845
17333
18669
35654
92266
627920
1509942
3582690
11761571
29915825
91057504

result:

ok 14 lines

Test #75:

score: 0
Accepted
time: 421ms
memory: 65560kb

input:

16665 999999 15
14603 14596
16412 14047
15052 14950
4207 4200
4081 4078
9531 9666
4384 4332
8680 8629
7105 7157
3667 3541
8922 8936
10621 10645
2194 2177
14725 14704
5703 5674
7079 7176
16362 16348
793 802
11203 11226
13282 13280
11117 11154
14282 14222
12722 12719
4218 4219
5299 5280
16382 16330
62...

output:

0
16650
16649
16648
16647
16646
16654
17684
27102
136728
9958463
1515412
126448708
415584
0
0

result:

ok 16 lines

Test #76:

score: 0
Accepted
time: 227ms
memory: 57444kb

input:

49996 257622 15
31467 31469
37343 37356
17778 17775
601 599
23406 23401
12858 13042
1279 1277
26381 26374
40487 40490
37344 37356
8923 8828
46532 46424
35894 35881
44610 44603
20238 20224
10603 10624
39306 38969
26271 26272
49221 49182
3365 351
41893 41891
37072 37056
37875 37873
27315 27296
23413 2...

output:

0
61289
69109
75450
84796
96798
139693
222196
395029
784850
2386909
7466261
20694561
47521913
165890555
1003185762

result:

ok 16 lines

Test #77:

score: 0
Accepted
time: 253ms
memory: 57364kb

input:

49997 255813 15
40718 40810
35795 35633
37890 37801
10966 10899
26768 24494
37006 37038
30069 30065
1816 1836
20960 20956
12827 12848
20792 20025
13787 13126
12612 12627
49049 49045
18018 18061
548 545
39814 39810
46803 46795
38963 38981
740 1599
39537 39478
45430 45367
2624 2616
29385 29293
19637 1...

output:

0
56697
62882
68119
72712
82017
122914
278938
798238
4881533
9301223
181384059
1052015821
0
0
0

result:

ok 16 lines

Test #78:

score: 0
Accepted
time: 405ms
memory: 60496kb

input:

50000 465004 15
33079 33083
20425 20424
39154 39147
40341 40336
25142 25103
37598 37647
20966 20964
7848 7853
42925 42929
2 44854
31263 31254
28559 28570
35966 35979
39692 48208
13631 2182
12308 12311
41385 41390
20655 20659
17686 17691
21720 22095
38264 38270
44896 44854
28010 29206
40634 40645
243...

output:

0
49985
49984
49983
49982
49981
49980
49979
50054
54766
203211
1410280
23596440
78163916
106052739
1039393825

result:

ok 16 lines

Test #79:

score: 0
Accepted
time: 366ms
memory: 60492kb

input:

49997 464756 15
47052 47053
46099 45629
14947 14784
23904 24117
32796 32792
9603 9622
25 162
23156 23167
1546 1583
26214 26429
22174 22297
45792 44077
17232 16909
43029 46654
7057 7092
26676 26694
7431 7653
20604 20549
42947 42949
26582 26588
15616 15593
29073 29656
44857 44846
34512 34506
18646 185...

output:

0
49982
49981
49980
49979
49978
49977
49976
50073
205916
397274
13624272
1234497765
0
0
0

result:

ok 16 lines

Test #80:

score: 0
Accepted
time: 60ms
memory: 55468kb

input:

50000 99998 1
30797 38748
281 14077
38620 9052
30129 3584
6025 20783
48991 7688
1887 31669
35337 43450
9821 23139
24115 17093
18959 4430
40841 14242
41443 25283
19509 5103
34162 24784
14151 1028
31087 526
17354 47506
23094 19870
34496 15112
23857 37371
47739 27113
33743 7301
32267 1257
4401 21529
64...

output:

0
1249975000

result:

ok 2 lines

Subtask #5:

score: 1
Accepted

Test #81:

score: 1
Accepted
time: 428ms
memory: 60480kb

input:

49999 500000 14
8451 9663
47608 35604
43707 49176
30218 12199
33000 6332
21117 37700
22586 49448
48986 4776
44551 21414
35 15791
36760 20522
39131 26292
26361 14373
25816 24129
43807 40898
9232 4733
37022 49437
48377 34456
21357 47546
19303 6932
19479 11761
45024 39091
11275 36126
30296 5456
35217 1...

output:

18779
68650
68722
68845
69044
69097
68956
69205
69178
69314
69199
69324
69668
69606
1248357518

result:

ok 15 lines

Test #82:

score: 0
Accepted
time: 302ms
memory: 58024kb

input:

50000 329985 15
7214 7217
3329 3330
48154 48155
6384 6411
47783 47780
15438 15460
42288 42300
1811 1812
41869 41864
45062 45095
5867 5870
7972 7975
45484 45488
45049 45055
48694 48697
48792 48809
40456 40467
9352 9356
1144 1145
49698 49712
49137 49165
5754 5766
45520 45527
43979 43978
44984 45009
47...

output:

0
52071
54552
57303
60749
64862
69792
76497
84915
94910
109913
134335
175522
246195
467329
1247526160

result:

ok 16 lines

Test #83:

score: 0
Accepted
time: 167ms
memory: 54356kb

input:

50000 119992 15
251 12047
221 1847
225 27799
224 39215
225 19946
224 4442
220 41909
237 23846
239 13530
220 24510
220 31782
224 25528
146 172
108 109
237 41835
221 19320
225 40257
237 43855
220 32243
206 25098
206 20778
225 40281
239 29084
225 27835
206 40720
220 42383
237 8241
224 38872
237 5773
22...

output:

2140
52875
54299
57556
65102
80751
110054
159923
241468
363601
569477
885757
1565579
2749140
7058483
1235258900

result:

ok 16 lines

Test #84:

score: 0
Accepted
time: 279ms
memory: 55592kb

input:

50000 249995 15
242 12051
221 29187
251 37163
222 10581
251 45962
251 24958
222 25277
224 14625
222 36222
242 13897
239 33823
205 7766
251 40758
222 33955
194 33797
224 49565
242 345
243 31646
224 39509
194 32010
222 13553
242 35864
222 39552
205 19048
239 27942
205 31790
251 4137
222 11588
244 1174...

output:

30
50017
50016
50015
50016
50018
50021
50033
50086
50359
51417
55509
70468
127757
391067
1248128276

result:

ok 16 lines

Test #85:

score: 0
Accepted
time: 460ms
memory: 59968kb

input:

50000 749295 15
244 5446
237 6028
188 43004
188 29425
213 30772
214 49863
213 32447
227 5384
251 42225
239 44285
247 27858
246 26722
218 27033
218 22040
237 17567
205 13219
247 18898
247 35114
251 45362
218 21704
214 39634
223 48376
227 40469
227 10122
205 5640
205 13538
205 24495
219 30797
218 3279...

output:

0
49985
49984
49983
49982
49981
49980
49979
49978
49977
49976
49975
49974
49973
49972
1248575406

result:

ok 16 lines

Test #86:

score: 0
Accepted
time: 602ms
memory: 67536kb

input:

50000 1000000 15
32400 32405
11281 11293
33951 33993
39349 39380
15024 15036
8433 8480
46550 46553
15144 15167
27659 27663
4084 5887
2708 2726
17680 17682
21333 21360
14745 14753
16344 16361
39535 39555
10744 10759
12449 12461
29892 29934
45078 45084
276 289
31207 31189
15758 15786
17528 18415
2490 ...

output:

0
394079
2117946
14136185
869425062
275573827
41704327
273001
29212295
16438383
0
0
0
0
0
0

result:

ok 16 lines

Test #87:

score: 0
Accepted
time: 459ms
memory: 65996kb

input:

49999 999997 15
28788 28793
45696 45697
25275 25289
900 911
49484 49469
36758 36761
29964 29979
11564 11521
17697 17695
27143 27123
4633 4606
20597 20606
22585 22591
44783 44770
35285 35282
19473 19468
19346 19343
19689 19688
13093 13094
11463 11469
48771 48728
8025 8038
4159 4154
39740 39741
33538 ...

output:

0
12448671
16804014
27421446
44911119
44500191
42956193
56823301
29153244
60096701
143410810
101212181
335643466
333843783
0
0

result:

ok 16 lines

Test #88:

score: 0
Accepted
time: 645ms
memory: 66636kb

input:

49999 1000000 15
26159 26162
49347 39586
16221 16223
29655 29659
16232 16227
16149 16160
26798 26793
43506 43540
146 2036
32972 32950
31804 31808
43053 43070
46201 46205
41091 41076
37833 37820
42584 42588
39586 39776
12178 12179
14933 14924
11063 11069
36138 36165
38339 38341
25018 25015
43078 4308...

output:

0
49985
50011
50374
51813
57334
86250
226911
2335150
3205388
5529637
9985141
32810304
211384154
182998293
800404375

result:

ok 16 lines

Test #89:

score: 0
Accepted
time: 478ms
memory: 66128kb

input:

49997 1000000 15
15759 15756
4886 4896
9571 9457
44825 44833
30199 30189
2692 2696
42460 42444
48640 48635
39433 38498
4348 4707
48184 48286
21646 21647
19541 19523
20554 20555
17465 17460
47101 47026
22616 22608
37662 37655
5409 5401
14382 14392
36708 36684
30968 30960
33558 33529
30635 30645
27719...

output:

0
55777895
111890500
208426238
211651564
84346044
2393868
3416486
1505474
2063673
2759494
21662220
33727026
282793936
167719668
58991067

result:

ok 16 lines

Test #90:

score: 0
Accepted
time: 614ms
memory: 66804kb

input:

49995 1000000 15
32642 32557
17234 17233
35323 35342
45775 45757
47957 47836
3010 2991
12002 12045
47679 47064
11876 11940
48261 48254
43514 43564
24091 24075
32350 32331
41635 42079
14984 14982
13253 13249
49801 49700
1761 1789
35827 35790
41552 41498
18311 18323
16420 16408
30814 30837
43645 43839...

output:

0
49980
49979
49982
50032
50627
56387
84397
194055
667663
2030251
6914496
17327645
60886897
197991555
962621244

result:

ok 16 lines

Test #91:

score: 0
Accepted
time: 533ms
memory: 66132kb

input:

50000 1000000 14
11956 11981
42729 42734
40622 40629
32630 32618
7778 7775
9367 9362
36375 36356
49016 49212
28566 28598
28697 28695
10470 10516
26822 26817
15651 15645
13202 13204
45424 45409
13946 13550
41248 41257
46186 46195
10511 10504
14849 14842
23342 23347
28283 28238
34333 34335
33065 33145...

output:

0
472627994
742883171
16945723
1593512
10682022
349310
149962
4093397
0
0
0
0
0
0

result:

ok 15 lines

Test #92:

score: 0
Accepted
time: 623ms
memory: 66692kb

input:

49997 999996 15
42858 42853
22764 22743
31242 31240
261 206
24200 24188
23868 23807
508 565
5623 5627
45537 45496
43650 43648
21001 20986
35135 35132
31865 31866
6216 5247
31134 31111
5689 5675
39318 39340
3808 3794
4441 4447
20365 20437
19922 19913
41427 41428
42297 42276
1204 1197
23610 23608
2442...

output:

0
50072
50397
51560
55474
161970
196150
359503
1882737
9253155
1237064135
0
0
0
0
0

result:

ok 16 lines

Test #93:

score: 0
Accepted
time: 639ms
memory: 66696kb

input:

49999 1000000 15
29374 29373
5506 5691
19958 19960
27807 27832
37931 37923
40487 40412
24936 25001
13101 13111
33934 33918
5096 5104
25272 25244
24302 23264
35918 35902
27607 27616
47555 47533
22055 22270
46369 46376
45841 45836
1756 1745
28919 28933
27891 28082
41875 41873
41699 41691
46443 46347
3...

output:

0
86397
163230
213971
270012
354355
643106
2342889
17693496
30951750
110782931
465713857
6543380
14045656
540255098
59164992

result:

ok 16 lines

Test #94:

score: 0
Accepted
time: 538ms
memory: 66072kb

input:

49995 999996 15
7868 7857
16333 16373
9090 9102
41040 41037
32263 37944
22224 22222
44836 44853
39225 39259
16820 16818
22562 22544
17105 17286
37074 37071
44405 44389
9386 9347
23533 23539
40319 40308
26197 26213
31530 31497
44927 44923
8871 8896
41384 41375
1704 1698
25721 25734
15552 15561
27867 ...

output:

0
42993900
189629042
141235477
8536228
50719871
51651287
40139212
233533964
138508295
49137662
58692951
114330603
127293132
2623566
0

result:

ok 16 lines

Test #95:

score: 0
Accepted
time: 444ms
memory: 65564kb

input:

16666 999998 14
3159 3152
5651 5671
13 9386
484 444
5492 5456
12956 12954
982 931
15487 15503
2523 2526
8390 8356
11106 11396
13791 13786
11756 11729
14531 14523
13079 13055
14628 14585
12609 12702
7733 7817
15161 15103
12621 12680
4935 4954
323 296
10931 10838
6930 4511
10803 10769
1818 1828
9487 9...

output:

0
16652
16651
16650
16649
16649
16657
17160
30107
138266
455298
2957735
16660537
25384344
92909523

result:

ok 15 lines

Test #96:

score: 0
Accepted
time: 396ms
memory: 65092kb

input:

16665 999996 15
11446 11625
13865 13830
13939 13948
12 2176
4894 4895
8419 8389
12446 12453
10491 1881
3892 3867
15040 15043
10883 10870
6808 6813
8915 8921
12561 12565
4825 4831
11633 11645
6994 7002
2240 2221
1992 2047
15522 15538
8932 8923
14109 14184
14580 14599
13586 13577
7904 7907
16290 16294...

output:

0
301474
5300041
603477
1009482
10835478
4689987
11408526
13195060
10074204
3123848
2803250
43417169
4306067
27551512
0

result:

ok 16 lines

Test #97:

score: 0
Accepted
time: 229ms
memory: 57604kb

input:

50000 263226 15
25014 25004
19636 19559
29192 29172
20843 20848
3288 3299
1612 1452
3730 3727
17296 17285
33032 35607
2626 2470
31176 31090
37146 37150
34359 34345
39001 39039
43914 43868
36251 36137
17543 17349
1310 1290
42677 42642
41997 42011
960 946
21884 21728
37640 37623
14268 14265
20617 2059...

output:

0
69760
76800
82090
83256
95933
105740
152169
309088
1464121
2850667
4186998
11978309
39966647
149271485
1038582042

result:

ok 16 lines

Test #98:

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

input:

50000 90957 15
25610 25599
2482 5954
12326 12331
49498 49502
26839 26900
47506 47503
49163 49033
33474 33477
26374 26335
10236 10322
28260 28257
28328 28327
39713 39739
42298 42300
25105 25117
21769 21775
47794 47789
12207 12251
4961 4962
25921 25918
15719 15722
42029 41973
33159 28333
23216 23220
4...

output:

0
1040484
1759659
3107715
6074248
11804564
17501508
104498981
147852711
58356476
178627628
288002212
430648919
0
0
0

result:

ok 16 lines

Test #99:

score: 0
Accepted
time: 403ms
memory: 60480kb

input:

50000 466245 15
5070 4792
8831 9061
19828 19854
26850 26852
44737 44740
533 542
46899 46835
46968 46946
49658 49466
49121 49108
46317 46321
16999 16984
16107 16097
14211 14152
30795 30767
21385 21363
10791 10800
16471 16462
47413 47432
16882 16948
33669 33644
24776 24617
18987 19006
34508 34532
2568...

output:

0
49985
49984
49983
49982
49981
49980
49979
49980
51001
86927
494331
4854430
25413867
159653561
1058321134

result:

ok 16 lines

Test #100:

score: 0
Accepted
time: 121ms
memory: 55408kb

input:

49998 149927 15
42782 41872
24607 24153
36828 36827
29487 29412
48648 48654
36422 36438
14349 14328
636 641
41993 41984
745 749
19953 19941
5974 5983
29842 29846
5656 5653
47319 47317
14 2168
9946 9943
31532 31523
7018 6966
38364 38360
28713 28698
1125 1128
42284 42311
45868 45880
33106 33239
47471 ...

output:

0
2395159
687289
1167283
6051857
30877776
25524114
27389867
35558884
44222501
84153569
151731982
200686739
142156805
496571311
0

result:

ok 16 lines

Test #101:

score: 0
Accepted
time: 779ms
memory: 66868kb

input:

50000 1000000 15
43916 43921
13119 13127
16904 16919
49346 49365
42355 42363
9186 9198
44983 45000
44639 44650
49437 49445
23918 23936
10590 10604
15761 15767
4616 4632
47521 47544
20832 20836
28482 28497
13753 13763
43005 43008
25543 25551
39131 39144
4953 4972
11577 11582
33172 33195
25984 26006
4...

output:

0
49985
49984
49983
49982
49981
49980
49979
49978
49980
49985
50002
50078
50363
52301
1248572544

result:

ok 16 lines

Subtask #6:

score: 1
Accepted

Test #102:

score: 1
Accepted
time: 1250ms
memory: 67524kb

input:

70000 1000000 30
27533 9943
48960 13744
52910 60232
44875 56836
37462 15774
67781 1878
32722 69261
37166 3079
27820 54868
24963 69502
55515 34942
55875 877
33007 52281
21879 49685
69183 32992
36260 50465
38748 6864
16727 3198
27918 4429
15312 5967
69884 32618
37330 753
16587 24875
2474 7451
56404 30...

output:

14187
84260
84309
84114
84367
84204
84162
84279
84317
84191
84263
84431
84485
84241
84365
84378
84417
84258
84402
84447
84468
84385
84413
84442
84385
84473
84468
84366
84505
84519
2445474934

result:

ok 31 lines

Test #103:

score: 0
Accepted
time: 437ms
memory: 58632kb

input:

69998 333333 28
5581 12198
22609 54570
2563 56652
614 59064
37853 35016
10218 57926
7089 43349
28798 49879
5223 60208
14462 54638
3395 25398
9515 18473
34349 67674
43821 15057
47708 12574
4619 38349
60872 24187
49373 33844
366 59531
55710 23381
44771 13356
29699 40418
43558 39222
54140 46076
61608 5...

output:

86122
156506
157989
160494
160149
162709
163061
164715
166927
167791
170275
171201
174044
176540
179298
183045
187478
193406
202224
213711
229337
255606
304035
388284
555259
955188
2106279
14997554
2424746208

result:

ok 29 lines

Test #104:

score: 0
Accepted
time: 771ms
memory: 64512kb

input:

33363 999990 30
16308 16309
29374 29482
20232 20243
17753 17801
7166 7190
21583 21667
31207 31237
20933 20961
1208 1205
28672 28729
17115 17191
15935 15941
16817 16839
17096 17103
12943 12952
3821 3869
16984 17001
24873 24893
17539 17599
28295 28425
2904 2983
12541 12546
16284 16299
23154 23162
3137...

output:

0
33333
33332
33331
33330
33329
33328
33327
33326
33325
33324
33323
33322
33321
33320
33319
33318
33317
33316
33315
33314
33313
33312
33311
33310
33309
33308
33307
33306
33305
554594860

result:

ok 31 lines

Test #105:

score: 0
Accepted
time: 211ms
memory: 54792kb

input:

70000 149998 30
91 22448
82 4398
87 43248
93 7648
98 10026
98 30253
82 48756
98 46218
87 65525
98 66549
87 15888
84 29410
87 16924
91 13221
98 4066
87 65425
98 43901
98 45800
82 15000
77 30566
82 48022
87 5830
98 54879
91 51622
93 13605
87 42710
87 35082
98 21382
87 12326
98 37328
28 35
74 58641
90 ...

output:

4285
76000
79660
88426
106693
144306
208166
306856
451485
663894
974161
1416957
2104267
3352987
4644699
6259138
9130203
11821835
19068308
23475026
38141419
63791322
86845945
81347174
167731710
130192925
139514922
226212228
241726610
141438205
1046615623

result:

ok 31 lines

Test #106:

score: 0
Accepted
time: 757ms
memory: 58504kb

input:

70000 500000 30
2 49588
62 29083
58 26201
101 53686
31 46400
7 11142
88 11027
2 4145
88 692
99 68569
51 32838
96 59479
35 37508
2 65001
7 64188
63 40519
2 27175
84 1891
35 21265
2 1899
88 3646
2 34239
62 64802
63 9281
37 2515
7 7623
51 14966
51 34824
86 10628
63 28798
2 53601
2 3823
62 27732
51 3808...

output:

1
69971
69970
69969
69968
69967
69966
69965
69964
69963
69962
69961
69960
69960
69961
69967
69971
69994
70108
70485
71715
75139
84697
105530
149267
223791
350561
582024
975208
2326820
2441660650

result:

ok 31 lines

Test #107:

score: 0
Accepted
time: 1095ms
memory: 63372kb

input:

70000 999988 30
828 35226
879 18090
776 803
943 25670
923 33760
855 42817
898 6313
876 36285
946 8498
924 30440
907 29609
828 14147
906 61172
863 52251
916 57317
909 66122
805 67533
935 59165
907 7268
914 50731
935 31132
916 41592
833 17814
761 41316
935 51442
863 46954
924 7492
935 18175
879 18412
...

output:

0
69970
69969
69968
69967
69966
69965
69964
69963
69962
69961
69960
69959
69958
69957
69956
69955
69954
69953
69952
69951
69950
69949
69948
69947
69946
69945
69944
69953
71772
2445904871

result:

ok 31 lines

Test #108:

score: 0
Accepted
time: 657ms
memory: 65896kb

input:

70000 1000000 30
52161 52176
53660 53688
28115 28117
55804 55816
27579 27605
47188 47186
22394 22428
65666 65685
9927 9930
7730 7745
18752 18759
53819 53836
5340 6703
48654 48668
65059 65057
67766 67774
60372 60376
38358 38364
52365 52381
21225 21237
60408 60425
29027 29019
32140 32162
1916 1911
164...

output:

0
276085
1474952
2605800
1494273385
216562144
364208728
9798407
84188902
9317161
25291780
27857293
52839868
18959471
28504091
15756677
22368118
19098991
28847054
25706528
0
0
0
0
0
0
0
0
0
0
0

result:

ok 31 lines

Test #109:

score: 0
Accepted
time: 910ms
memory: 67200kb

input:

70000 999999 30
21034 21025
32212 32196
63103 63173
20198 19932
16449 16464
58290 58378
66226 69227
58957 59018
51473 51538
6030 6034
29605 29542
33329 33349
24341 24344
3977 3987
59541 59517
15340 15341
51774 51891
65930 65868
7139 8862
4748 4745
46394 46404
30533 30544
30804 30803
43425 43470
3533...

output:

0
74363
77168
79085
79790
91678
97877
104495
135024
177719
233981
328890
386024
717868
890145
1302232
2675510
3210785
3048957
5010551
11136249
7671017
26550010
52573263
59304489
939503703
49043931
46105718
3144708
1234180205
0

result:

ok 31 lines

Test #110:

score: 0
Accepted
time: 1170ms
memory: 67300kb

input:

70000 999995 28
55248 55203
28680 28673
15373 15526
42273 42421
60687 60690
41900 41874
33438 33199
4082 4135
50543 50036
55265 55282
39306 38869
9369 6891
30530 30587
36450 36432
30839 30775
33071 33072
5451 5420
28111 28104
58617 57105
57847 57849
57205 57175
43210 43272
164 5184
66658 66649
23748...

output:

0
69972
69971
69970
69969
69968
69967
69966
69965
69964
69964
69964
69965
69967
69969
69969
69980
70148
78153
94561
252162
780884
3643783
12515093
25357893
72697161
100053867
567279563
1664132620

result:

ok 29 lines

Test #111:

score: 0
Accepted
time: 1101ms
memory: 67192kb

input:

70000 1000000 29
757 765
27750 27652
48626 48613
17707 17354
18946 18963
48139 48131
9424 9468
33641 33579
12919 12897
32684 32634
44493 44553
4536 4550
31903 31643
33352 33353
17019 17011
35327 35339
34091 34088
52356 52370
55052 55049
29443 29419
69604 69644
15577 15584
32133 32117
54123 54126
409...

output:

0
69971
69970
69969
69968
69967
69966
69965
69964
69963
69962
69968
70015
71398
74746
87125
165366
370477
543119
1118262
3098261
4466444
13273364
25451829
47466313
171728625
118441963
623931775
260811671
1176065020

result:

ok 30 lines

Test #112:

score: 0
Accepted
time: 1107ms
memory: 67280kb

input:

70000 999995 30
46019 46035
18148 18241
13165 13164
54292 54058
58809 56498
44943 45006
46394 46351
69488 69508
64830 64795
24695 24704
2569 3338
45757 45737
59957 60017
3533 3542
60762 60735
11208 11204
280 291
58895 58869
22853 22887
56257 56248
40265 40242
16801 16902
40857 40838
38934 38951
1844...

output:

0
69970
69969
69968
69968
69967
69966
69965
69964
69963
69962
69961
69960
69959
69959
69958
69957
69971
70062
70346
78028
130398
474087
1467408
3498463
12263680
26759049
103832143
165154463
626921099
1506026822

result:

ok 31 lines

Test #113:

score: 0
Accepted
time: 1090ms
memory: 67288kb

input:

69999 1000000 30
8959 9112
51519 51500
42291 42296
5402 5406
38438 37709
27119 27133
3221 3214
64505 64691
20228 20290
32522 32546
41583 41586
33342 33270
27683 27632
11340 11664
53157 53156
30841 30867
41463 41424
8254 8315
639 607
30734 30761
49321 49228
33807 33800
59541 57954
46127 46155
63995 6...

output:

0
69969
69968
69967
69966
69965
69964
69963
69962
69961
69960
69959
69958
69957
69957
69956
69955
69954
69953
69953
70069
72893
170163
308399
1450574
7162288
15704648
56215789
372150256
154702190
1838528949

result:

ok 31 lines

Test #114:

score: 0
Accepted
time: 826ms
memory: 67200kb

input:

70000 999995 30
33245 33283
58884 58888
50858 50861
57086 57077
18891 18890
34194 34234
47228 47235
6156 6152
54475 54354
12014 12262
17956 17888
57529 57522
51314 51318
29 24730
65077 65020
10228 10222
15813 15791
68788 68927
60766 59936
54019 54040
8821 8826
25276 25304
3468 3456
56027 55997
26460...

output:

0
85552
97848
100655
166586
283691
260687
990316
2243150
1655400
5045574
1864791
814055
4346312
5333377
29871818
30708121
1244064337
1120003165
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 31 lines

Test #115:

score: 0
Accepted
time: 1078ms
memory: 67184kb

input:

70000 1000000 28
17710 17943
31460 31453
51630 51626
35396 35384
53456 53449
40719 40579
58460 58434
9237 9415
14125 14015
22707 22698
54408 54407
28461 28453
59595 59547
36407 36344
3907 3904
35484 35446
69472 69481
2103 2158
35661 33906
47182 46822
39229 39235
46658 46655
30882 30885
57329 57328
1...

output:

0
69972
69971
69970
69969
69968
69967
69966
69965
69964
69963
69962
69961
69960
69959
69958
69957
69959
70681
88829
324378
1568394
16973788
110514960
536109693
1781235264
0
0
0

result:

ok 29 lines

Test #116:

score: 0
Accepted
time: 815ms
memory: 66808kb

input:

70000 1000000 28
27079 27041
60258 60309
29593 29575
58277 50746
48015 46962
59598 59556
33346 33379
63413 63639
48906 48916
37588 37586
47832 47724
48073 48468
4802 4907
32752 32761
34852 34862
11046 11072
52012 51669
52292 52323
47826 47811
42863 42861
51117 51162
40783 40836
36451 36456
21129 209...

output:

0
120820
141145
160576
199298
277837
385266
423116
655886
1263267
1519582
1142751
2438250
3011539
4584873
5936342
11699545
9078361
12721127
37467089
42427908
109669045
135773058
100172793
113158037
16011326
57448050
1095328666
684859825

result:

ok 29 lines

Test #117:

score: 0
Accepted
time: 963ms
memory: 66964kb

input:

70000 999995 30
21576 24202
53376 43275
32223 32085
3009 69626
51356 51406
59717 60329
55310 54867
52343 52378
14122 10325
39502 42031
3428 4900
62435 62365
13946 13919
48762 48765
6136 5781
10423 10706
62452 61702
58881 58815
35790 35278
39238 39353
41368 41485
34539 34592
6524 6527
6664 6595
48341...

output:

0
69978
69985
70000
70013
70070
70241
70343
71173
73083
74536
85957
114280
100024
147168
220495
329945
530974
583866
1301938
2455104
4881650
12084693
16649267
29608267
48140600
78839791
65991946
564831530
708850607
911477911

result:

ok 31 lines

Test #118:

score: 0
Accepted
time: 898ms
memory: 66864kb

input:

70000 1000000 30
69992 69625
48297 48367
25996 25928
27333 26372
15603 15012
23105 23324
15809 15896
62802 62814
6556 6350
46814 52664
43435 40131
326 66074
50941 50937
16295 16478
49104 49066
65319 65062
46474 58439
69016 68880
30152 30162
22087 22094
42814 42849
35128 35068
6516 6462
1721 9003
167...

output:

0
70303
70624
70707
72492
73232
74122
78258
82641
91686
115268
152223
215047
290004
466148
737886
1157805
2264976
3632108
5666444
4001039
11735223
10109808
28394115
41792951
22185130
130851864
43170358
383672038
686493443
1070147492

result:

ok 31 lines

Test #119:

score: 0
Accepted
time: 737ms
memory: 66060kb

input:

35000 999999 30
16579 16553
2222 2512
20137 20119
27050 27033
15573 15742
26060 26756
25854 25860
15999 15986
15302 15420
9234 9579
9980 10285
26269 26262
14430 14425
6984 7032
28703 28672
4269 4260
15519 15533
33041 33024
31921 31926
30183 26114
22039 22059
14338 14501
26235 25472
31447 31849
29616...

output:

0
34970
34969
34968
34967
34966
34965
34964
34963
34962
34961
34960
34959
34958
34957
34956
34955
34954
34953
34952
35006
36321
43997
101213
371746
1441224
4944969
15242202
40785031
545994291
1807676

result:

ok 31 lines

Test #120:

score: 0
Accepted
time: 633ms
memory: 65928kb

input:

34998 999997 30
10088 10091
20270 20249
26723 25720
22555 22577
29877 29874
10136 10219
9307 9396
3595 3503
30689 30624
9807 9514
1674 1958
22514 22499
21411 18529
8558 8515
21349 20394
24221 24163
10765 10823
34326 32642
11527 10420
3135 18670
444 1378
27951 28047
34925 34764
7554 7548
14524 14429
...

output:

0
34999
35155
35305
35967
36616
37714
38742
42746
48645
53131
66204
108634
191485
211826
331515
309134
511158
1236419
729869
1897704
2669203
3445478
12891692
16241864
4585979
54188141
12302056
102560134
337816534
58703947

result:

ok 31 lines

Test #121:

score: 0
Accepted
time: 526ms
memory: 61736kb

input:

70000 559066 30
63355 43055
66434 66482
7608 7620
62300 62385
47486 47491
17266 17379
4974 4973
45121 45125
66638 67356
25100 25115
63355 28331
20658 20643
59407 59439
21236 21279
34271 34377
24296 24279
34859 34879
43831 43509
26152 26151
22024 22167
16068 15848
35583 35562
16668 16665
36599 36596
...

output:

0
90155
109838
126769
139769
148111
154500
161452
166123
173255
183810
192005
222911
228530
276533
473735
377668
399950
387959
582144
1330022
2522807
1654986
9075875
9503733
5184381
34287563
36981385
246651292
287194022
1808954152

result:

ok 31 lines

Test #122:

score: 0
Accepted
time: 368ms
memory: 59600kb

input:

70000 392514 28
49298 49246
30732 30719
21532 21592
3812 3811
16801 16877
481 489
27793 27881
9462 9446
53658 53022
3343 1884
14344 14521
62835 62813
48290 48235
5992 5998
9417 9404
61200 61212
50963 50836
39759 39720
23810 23842
6673 6666
63047 63019
27574 27594
17237 17230
33219 33244
46151 46180
...

output:

0
115212
136122
156484
168018
178222
185032
191634
210555
252037
294656
382593
593754
1181585
3899528
3506747
5432959
11139617
9686930
36867248
30699441
27485651
2276309406
1181523
37820424
0
0
0
0

result:

ok 29 lines

Test #123:

score: 0
Accepted
time: 681ms
memory: 64192kb

input:

70000 735144 30
12292 12289
8073 8077
60368 60373
12151 12230
43909 44459
11438 11556
1944 1943
30139 29741
60958 61086
7723 7716
26376 26203
29724 29935
10611 10662
13645 13700
21726 21616
12867 12875
24652 24732
31305 31292
30022 30001
20711 20722
22634 22530
50173 50212
3900 3905
43735 43791
6461...

output:

0
101785
119203
134229
140477
140948
142799
146230
149903
151423
150914
151634
153073
156020
157037
159904
169896
195936
1657516
448764
677299
1348772
1340630
7880495
5320801
7257587
74811959
12441002
44573417
342011962
1945643820

result:

ok 31 lines

Test #124:

score: 0
Accepted
time: 384ms
memory: 59496kb

input:

69997 393251 28
31834 31856
50829 50781
34317 34324
20800 20847
21589 20979
7077 6991
52796 52786
68169 68129
69253 69262
7766 7742
35094 35560
8630 6663
29573 29196
311 342
16650 16454
26786 26918
54303 54088
49286 49046
34822 34542
40977 39479
4984 4266
13952 13702
40996 37563
69696 69694
65076 65...

output:

0
109021
129766
149176
160577
165594
181952
194428
265793
227953
316644
456903
530793
649671
1345557
1718901
2583382
4154880
3790438
6969971
14203629
21109119
13332622
23665098
46283548
98602748
267435225
596847863
1342284213

result:

ok 29 lines

Test #125:

score: 0
Accepted
time: 408ms
memory: 59556kb

input:

69997 406341 27
68374 68393
3591 3657
12329 12331
48924 48761
42807 42827
20547 20597
67313 67315
56137 56275
51799 51797
17078 17095
69697 69695
51956 52083
53352 52925
4097 4082
42534 42557
64587 64580
29203 29192
26659 26651
3037 2908
46457 46449
17965 17969
24149 24879
40489 40505
65826 65817
58...

output:

0
157245
174100
201672
237318
271165
351569
470125
761671
693836
1058677
1599342
2944424
2430771
4575125
6208319
13741443
23830236
18383660
43112457
33558585
125103816
144001105
409663721
1614405053
0
0
0

result:

ok 28 lines

Test #126:

score: 0
Accepted
time: 834ms
memory: 65168kb

input:

70000 889436 23
29453 29475
30307 30282
43405 43554
59972 59901
53086 53096
25722 25727
56408 55699
64486 64499
68339 68382
45451 45441
6601 6608
51581 51583
61166 61206
66122 66178
44261 44244
24219 24294
50661 50659
4340 4503
36867 36955
29321 29672
52223 52222
6098 6085
62098 62101
61200 61205
33...

output:

0
69977
69976
69975
69974
69973
69972
69971
69970
69998
70254
71760
90630
532077
541603
3430209
55098116
451423648
28446778
1785428791
340926
122320675
0
0

result:

ok 24 lines

Test #127:

score: 0
Accepted
time: 676ms
memory: 66784kb

input:

70000 1000000 30
186 335
186 1002
186 2321
186 3863
186 6132
186 14915
186 34716
335 1090
335 2750
335 3993
335 6795
335 15153
335 34809
1002 1090
1002 2791
1002 4258
1002 7104
1002 17135
1002 35467
1090 3747
1090 4401
1090 7521
1090 17427
1090 36068
2321 2750
2321 2791
2321 4959
2321 7905
2321 1776...

output:

3
69972
69973
69995
70151
71313
77592
104209
207864
485592
1318995
2784238
5156244
7437969
10920075
10889152
12713577
15105210
15377966
17605673
17429257
20609705
26431750
33533060
68405107
42975621
84089914
319531019
87172856
138193010
1509028373

result:

ok 31 lines

Subtask #7:

score: 1
Accepted

Test #128:

score: 1
Accepted
time: 692ms
memory: 60924kb

input:

69999 500000 29
60938 42787
36148 15312
17077 62566
36724 15655
25348 24373
9403 47728
18478 29610
64349 17652
40061 61284
28202 31379
33229 65668
55838 49941
20749 7682
29174 22329
4738 51379
61834 65526
51830 26697
42178 39473
15702 64077
66057 18316
50196 6614
64655 50197
60126 49955
21698 64722
...

output:

38719
109057
108593
108773
109144
109053
109269
109566
109543
109648
109565
110180
110201
110196
110233
110451
110453
110269
110510
110808
111125
111275
111253
111644
111439
111772
111915
112053
113553
2444805175

result:

ok 30 lines

Test #129:

score: 0
Accepted
time: 568ms
memory: 59612kb

input:

70000 359970 30
1104 1168
3363 3357
67931 67938
3594 3602
4925 4941
1788 1804
2628 2637
4907 4954
2981 3004
2979 3025
1765 1804
3693 3755
65425 65450
67839 67854
68462 68482
23 69
67798 67804
3550 3576
3252 3274
69296 69316
12234 12303
66566 66594
66115 66141
4486 4492
2595 2629
69140 69141
69381 69...

output:

0
71946
74151
76573
79207
81892
84827
88074
91525
95323
99659
104145
109788
115720
122315
129547
137940
148772
161836
174487
189991
208888
235706
268323
309151
372785
463989
614515
937717
1864222
2440422421

result:

ok 31 lines

Test #130:

score: 0
Accepted
time: 116ms
memory: 56744kb

input:

70000 69970 30
6982 6991
64895 64902
55869 55880
20637 20656
61556 61583
67944 67940
61071 61090
4458 4474
27239 27286
52920 52962
22029 22109
6976 7002
6377 6378
62047 62083
16631 16657
60273 60259
33179 33191
7429 7462
2874 2898
28457 28458
29028 29043
26464 26528
69033 69085
29817 29827
27300 273...

output:

0
72336
74911
77821
80819
84066
87678
91612
95845
100160
105629
111165
117029
123007
130673
139848
149672
160000
173340
187758
206348
231280
260795
298332
345916
408620
522851
687178
1047924
2128081
2439634741

result:

ok 31 lines

Test #131:

score: 0
Accepted
time: 382ms
memory: 55768kb

input:

70000 249998 30
70 60123
71 13303
106 50569
83 42021
106 1795
77 50968
62 42981
62 18768
106 15925
71 28422
83 42857
37 69139
70 66390
56 58682
75 689
34 61970
83 38970
71 47615
34 9203
34 12446
71 21647
106 5729
71 13308
71 14347
71 40454
106 47016
48 930
34 23557
71 7542
106 14111
71 11957
88 6639...

output:

466
70494
70584
70730
70999
71599
73105
76439
83410
96434
121522
160844
215235
291699
387815
494194
645277
841814
1111696
1489731
1817717
2421697
3181150
4336325
5712163
7809742
11627294
20614977
31119459
73895627
2278955197

result:

ok 31 lines

Test #132:

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

input:

70000 699992 30
84 26107
42 65269
35 40605
88 4324
100 36938
72 8486
88 6264
6 41766
68 29001
42 44142
35 58830
35 33147
7 32091
88 67874
6 58244
6 38309
57 16233
72 39126
93 3818
6 65443
19 271
72 15944
87 56646
87 13657
6 32195
35 29953
35 68655
6 11891
35 2007
87 13364
48 3798
74 8916
95 34869
85...

output:

0
69970
69969
69968
69967
69966
69965
69964
69963
69962
69961
69960
69959
69958
69957
69956
69955
69954
69953
69952
69951
69950
69949
69951
69955
69996
70452
75879
113220
397696
2445529177

result:

ok 31 lines

Test #133:

score: 0
Accepted
time: 692ms
memory: 65864kb

input:

70000 1000000 30
18696 18751
53957 54036
57794 57849
9667 9673
19865 19873
44633 44647
45332 45430
13684 13776
66331 66327
18705 18726
32379 32419
8213 8219
58703 58755
54623 54736
34818 34853
6332 6328
25576 25672
51471 51559
38051 38102
59529 59623
5740 5775
43029 43165
57029 57027
11328 11367
249...

output:

0
1287080
9665500
13259222
19109980
27912052
109384633
131909562
81482723
1377344687
96756884
249358455
3008925
47452482
90005156
83580050
15961244
90456800
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 31 lines

Test #134:

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

input:

70000 1000000 30
34367 34528
55344 55347
6705 6708
33996 33978
9934 9936
63419 63352
57872 57873
26759 26757
442 454
14748 14761
19747 19700
25076 25077
53556 48873
1611 1613
10422 6422
40902 40907
504 478
46713 46598
35116 35265
39957 40084
65949 65937
14287 14285
13658 14970
22256 22255
43683 4367...

output:

0
80912
85802
91331
94468
107256
115837
152962
214017
324241
485423
508806
973444
2679015
1423422
1322211
3617812
6352372
8439118
10526636
6518263
43043821
26997805
33299519
72371970
63463466
140917084
185086259
1079299193
759342970
0

result:

ok 31 lines

Test #135:

score: 0
Accepted
time: 1017ms
memory: 67276kb

input:

70000 1000000 29
47233 47236
24301 26776
24008 23946
25954 26004
50424 50427
15203 14756
36187 36184
67223 67222
31203 34447
25843 25787
14072 14083
41345 41415
29531 29558
66270 66278
22651 22685
31110 31109
51434 51451
64212 64333
66417 6583
14764 14788
57489 57534
2061 2067
39090 39084
64662 6467...

output:

0
69971
69970
69969
69968
69967
69966
69965
69964
69963
69964
69963
69962
69962
69963
69966
70098
74011
93730
152401
353759
2697190
4851771
7564512
13678744
17712903
97466329
215055980
260641085
1826543410

result:

ok 30 lines

Test #136:

score: 0
Accepted
time: 1085ms
memory: 67240kb

input:

69999 999995 29
42177 42170
68019 68028
474 500
61675 62495
62838 62860
58838 57183
55750 55751
28441 28473
5016 5046
25183 25144
20188 20225
52052 52098
66624 66587
41983 42011
23377 5235
19780 19722
14418 14812
69079 57637
4334 4350
50671 51850
36492 36432
36839 36873
24071 24097
5535 5526
38733 3...

output:

0
69970
69969
69968
69967
69966
69965
69964
69963
69962
69961
69961
69960
69959
69958
69961
69960
69965
69968
69979
70288
77980
130635
692370
2880211
20956989
36728779
199950524
179042750
2006075583

result:

ok 30 lines

Test #137:

score: 0
Accepted
time: 753ms
memory: 66984kb

input:

69998 999998 30
41263 41235
24049 24074
49461 49452
1776 1775
54695 54657
37611 37604
69274 69336
66093 66565
49488 49545
4823 4829
41484 41503
16148 16141
53170 53169
13620 13623
13001 12925
8355 7874
56755 57207
38121 38126
65959 65931
66883 66066
39404 39440
45517 45537
68289 68282
12887 12135
55...

output:

0
167328
101236
110341
128095
155416
264765
190702
1383640
1542140
6324550
510441449
135489994
62322357
66013383
242178315
147838531
8449309
6843656
7331158
229952387
57205664
453654046
33523844
45485574
14564227
14440592
77791790
321902765
1998242
0

result:

ok 31 lines

Test #138:

score: 0
Accepted
time: 1072ms
memory: 67180kb

input:

70000 1000000 30
36898 36856
24659 24594
23607 23598
39368 39414
1082 1065
5955 6040
3986 3964
12364 24043
27309 27441
21114 21113
17587 17610
2160 2183
23032 23127
61388 61350
53496 53507
35929 35858
66473 66464
65183 65182
14193 14148
48636 48445
49733 49612
40834 40874
49289 49307
55975 55979
350...

output:

0
69970
69969
69968
69967
69966
69965
69964
69963
69962
69961
69960
69959
69958
69957
69956
69956
69955
69954
69955
69956
74033
117024
337885
1403617
5996471
18415809
589285079
1296010702
24810321
510085273

result:

ok 31 lines

Test #139:

score: 0
Accepted
time: 960ms
memory: 67348kb

input:

69999 1000000 29
37276 37062
12417 12416
61064 61051
13063 13056
65285 65300
55160 54804
3824 3455
47002 46545
41252 41174
55610 55687
38126 38122
60711 59177
51792 42620
52757 52514
51869 51800
60238 56880
54930 54929
4911 4096
23287 23286
55491 55490
33836 34043
10236 10200
28571 28480
11109 11108...

output:

0
69970
69969
69968
69967
69966
69965
69964
69963
69962
69961
69960
69959
69958
69957
69956
70080
71342
489963
339559
734212
3166221
16472463
99628860
220581010
2105332280
0
0
0
0

result:

ok 30 lines

Test #140:

score: 0
Accepted
time: 1030ms
memory: 67188kb

input:

70000 1000000 30
45597 45594
13905 13939
14185 13848
64262 64452
60457 60459
60641 60642
1500 1490
18566 18517
8779 8843
9670 9654
24850 24847
29795 29753
19880 19854
61946 62005
30462 30568
8299 8314
63842 64058
41909 41907
3471 3481
2541 2780
47708 47552
1703 2296
27969 28014
6491 6502
48309 48224...

output:

0
69970
69969
69968
69967
69966
69965
69964
69963
69962
69961
69960
69959
69958
69958
69957
69956
69955
69956
72286
108175
195259
1621953
3960320
24129404
2416588724
0
0
0
0
0

result:

ok 31 lines

Test #141:

score: 0
Accepted
time: 970ms
memory: 67148kb

input:

70000 1000000 29
42843 42846
11321 11357
1839 1440
17782 17841
47104 48465
10974 11834
45804 45785
47888 48756
65933 65787
47640 47633
32205 32179
20007 19879
13707 14475
67075 67066
46364 46992
18656 18516
36686 37169
35888 35850
47111 47070
52350 52323
24904 24923
53824 53901
29422 29053
26793 269...

output:

0
69971
69970
69969
69968
69967
69966
69965
69964
69963
69962
69961
69960
69959
69959
69958
69958
69957
69956
70035
89528
117841
189743
3644559
25828806
93746552
648382324
1674676685
0
0

result:

ok 30 lines

Test #142:

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

input:

69996 999999 28
67935 67942
39283 39160
15350 15358
14999 14986
7298 7274
53573 53575
55070 55373
613 736
40463 40471
15512 15597
61823 62160
65082 65087
2877 3534
10136 10517
17206 17056
31954 31953
27645 27648
37113 37075
40778 40790
14988 15102
52881 52806
16706 17010
43386 43383
45992 46191
4169...

output:

0
69975
69976
70002
70067
71934
70484
70998
72953
74926
84145
93378
132289
183700
225805
495784
349356
884250
3297605
3323934
2278371
9869839
7803306
12057120
22112288
78379369
253297814
143339218
1908946610

result:

ok 29 lines

Test #143:

score: 0
Accepted
time: 858ms
memory: 66956kb

input:

70000 999997 29
54704 55098
68143 63267
13452 41592
5121 5209
57624 57198
15465 15471
52321 52260
67755 67816
53430 53193
34229 38172
62374 62380
28279 28288
66029 66116
68960 68962
9531 9974
50564 50544
60469 61025
28899 28893
62282 62722
28534 28928
8589 8449
9250 9196
16051 13761
31154 31910
6490...

output:

0
70512
73501
75527
81979
77151
89374
131566
120476
137592
197386
238728
217220
392118
548849
1309922
1730030
3221779
2991202
5086742
14031901
16995678
26746949
45273137
22524377
115041695
130751075
267419501
497248223
1295181216

result:

ok 30 lines

Test #144:

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

input:

34997 999996 30
11223 11214
5316 5334
3862 9400
28122 28095
15247 15290
13116 13114
30058 30065
28670 28690
6792 9183
22642 22646
29471 29473
17865 17731
32940 32938
721 849
20512 20517
7325 19888
14084 14094
6329 6372
25652 25579
2792 2903
3968 3996
9953 9830
9737 9658
8950 8962
1114 1111
16238 162...

output:

0
34967
34966
34965
34964
34963
34962
34961
34960
34959
34958
34957
34956
34955
34954
34953
34952
34951
34950
34949
35039
36509
50272
130344
601777
1673597
3173659
26710893
77636965
500649771
0

result:

ok 31 lines

Test #145:

score: 0
Accepted
time: 683ms
memory: 66184kb

input:

35000 999995 30
81 129
19665 19668
2757 2753
3471 3518
21144 21221
713 640
32607 32623
9318 8798
14844 14877
3901 3889
1926 1947
23415 23251
33130 33072
26623 26608
32834 32279
22993 22871
19932 19733
16824 16827
28129 27805
1560 1583
34373 34524
11939 11920
3329 3245
22836 22271
11386 11361
2886 28...

output:

0
34970
34969
34968
34967
34966
34965
34964
34963
34962
34961
34960
34959
34958
34957
34956
34955
34954
34953
34952
34951
35723
60386
324154
550525
5446551
10190495
594160891
0
0
0

result:

ok 31 lines

Test #146:

score: 0
Accepted
time: 408ms
memory: 59856kb

input:

70000 409222 29
12894 12944
7874 7859
14671 14687
44877 44874
17565 17592
19173 19188
32188 32175
14319 14308
58270 54712
14961 14977
69530 57939
27668 27683
57225 57175
20170 25633
58185 58205
60657 60648
17001 16967
68891 68954
15811 15796
13846 52631
24615 24633
50180 50192
10184 9988
4097 10494
...

output:

0
85964
103564
119597
133705
146874
157196
168667
187162
203953
281445
472783
520082
652863
627278
772020
1244739
958847
2580383
7711696
8368129
11750497
11129298
19298290
26559488
78498948
778920460
50104186
538409490
907837802

result:

ok 30 lines

Test #147:

score: 0
Accepted
time: 668ms
memory: 64240kb

input:

70000 731802 30
4930 4936
29229 29164
29749 29632
59833 59809
13913 13914
3472 3479
22212 22173
53256 53295
55253 55230
25359 25267
66494 68704
61658 61532
45830 45861
59504 59549
11898 11922
58726 58624
12522 12518
18244 18250
52573 54463
37717 37706
33711 32143
12687 16439
35607 35613
63880 63908
...

output:

0
101153
117897
133226
139115
140970
141632
144534
148787
151873
154226
155137
162816
170318
180361
238200
225238
275882
497795
838952
603838
742210
1835422
1249856
3029074
5440793
17364992
114367186
103764324
447483227
1747936401

result:

ok 31 lines

Test #148:

score: 0
Accepted
time: 478ms
memory: 61640kb

input:

69996 532643 29
25468 17391
34484 34493
11615 11540
14083 14081
22890 22981
44330 44955
68083 67969
4799 4795
21219 21281
35846 35929
21722 21630
31159 31395
53856 53925
46253 46271
41789 41853
11114 11237
25221 25203
25190 25063
1736 1769
55503 55442
31464 31465
29397 29365
58603 58496
152 161
5633...

output:

0
84126
99782
113447
125112
134886
143042
149619
154847
160208
164080
170653
182904
217691
282128
402612
1306789
1724033
1549786
2558845
8800845
11947231
48131798
55779830
10094482
11697563
23372353
153720474
1840026778
274429584

result:

ok 30 lines

Test #149:

score: 0
Accepted
time: 351ms
memory: 58752kb

input:

70000 348289 30
15613 15606
57321 57336
48921 48917
38701 38697
61447 59516
17999 19650
26847 26806
49579 49473
24598 24569
44075 44072
7789 7804
59524 59549
53455 53427
1484 1480
6338 6348
9828 9863
53455 53401
43215 43221
8878 20405
934 926
30212 30069
67703 67707
14424 14380
18353 18387
32798 326...

output:

0
100677
124249
144217
157565
169712
178936
197450
224814
282060
326208
575637
1234260
925021
1212416
7916116
4270980
16081553
3556500
27849453
35582757
40530870
74828987
54369606
53544952
107519880
153928897
44338962
664046318
1087710873
66005509

result:

ok 31 lines

Test #150:

score: 0
Accepted
time: 434ms
memory: 59588kb

input:

70000 432001 30
50637 50645
66937 66887
24357 22321
31960 31961
68178 68177
43130 43126
68488 66264
11627 13251
55393 55387
10943 11447
41649 41450
8664 8651
53723 53898
57759 57762
34877 34861
56966 52002
56815 56810
22302 24295
24432 33753
61930 60376
20669 20867
29167 29086
24234 24332
33051 3134...

output:

0
102150
120161
135446
144332
146915
155634
166882
213709
213476
244341
548948
605921
559566
873181
1392183
1249135
2185675
3086133
5571633
12324576
13991729
7796232
12006829
20042861
56034032
94784087
241486431
222983112
620183598
1128586527

result:

ok 31 lines

Test #151:

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

input:

70000 921967 27
37899 37857
60644 60678
49209 49207
57034 57276
21849 21877
47991 47908
14277 14290
61022 61038
58503 58507
14936 14882
39210 39200
61400 61387
65907 65914
6448 6457
50901 50966
38778 38779
33973 34005
44510 44562
44125 44119
25186 25123
37175 37202
65282 65346
68650 68721
56765 5663...

output:

0
69973
69973
69974
69974
69980
70048
70177
70307
71274
78801
83441
97851
142642
313003
501995
1557403
2971643
7396923
6307039
25219204
66102555
242621499
347569010
190179274
358342985
131191689
1066836714

result:

ok 28 lines

Test #152:

score: 0
Accepted
time: 557ms
memory: 60868kb

input:

70000 528900 27
11947 11968
58142 58041
53395 52721
41287 41254
39831 39569
40951 40960
68975 68974
51190 51262
44529 44444
64273 64286
18312 18650
41816 41514
32111 32149
54940 55071
10606 17663
37558 37488
43303 43479
36556 36580
42089 42046
30345 30351
42867 42916
43725 43711
32124 32138
11033 11...

output:

0
74423
80307
98459
114554
128702
175897
669570
604215
968262
533847
1559641
2216268
2178951
4125400
5225129
5145152
7088721
10961974
18366699
47094049
66848171
29383149
102170227
283855182
175458449
225517602
1457502351

result:

ok 28 lines

Test #153:

score: 0
Accepted
time: 786ms
memory: 67664kb

input:

70000 1000000 30
32 33
32 34
32 36
32 40
32 48
32 70
32 102
32 173
32 309
32 581
32 1116
32 2193
32 4360
32 8739
32 17437
32 34877
33 35
33 37
33 41
33 49
33 71
33 103
33 174
33 310
33 582
33 1117
33 2194
33 4361
33 8740
33 17438
33 34878
34 35
34 38
34 42
34 50
34 72
34 104
34 175
34 311
34 584
34 ...

output:

4
69971
69973
69994
70093
70665
74314
88079
116052
186105
300304
444833
615689
760128
904139
1078671
1620392
1636748
3752643
4252693
12977717
8247837
47331487
10296160
149463963
29066612
437152795
40981042
491609004
151650655
1052976673

result:

ok 31 lines

Subtask #8:

score: 1
Accepted

Test #154:

score: 1
Accepted
time: 2055ms
memory: 68580kb

input:

100000 1000000 50
92999 77320
11746 6374
11113 48883
3765 30529
48050 41374
43964 55281
72039 28956
73896 23173
60646 84514
83912 9312
88361 68809
49972 16619
20949 36967
41288 55033
30115 57398
84781 21275
91108 64332
81204 87998
15398 70615
1116 27156
97295 12872
89612 49202
62495 32370
70840 4614...

output:

29512
129207
129532
129180
129234
129389
129495
129417
129441
129546
129471
129393
129603
129585
129609
129471
129645
129562
129731
129620
129647
129500
129737
129890
129886
129815
129693
129899
129969
129811
129978
130101
129992
130124
129802
129939
129981
130190
130125
130079
130381
130284
130335
...

result:

ok 51 lines

Test #155:

score: 0
Accepted
time: 925ms
memory: 69804kb

input:

99960 999500 10
60284 60290
76900 76913
52862 52874
58438 58477
78139 78141
7618 7635
30153 30152
34052 34051
41877 41891
23727 23737
85606 85630
13210 13217
35850 35859
90444 90445
92188 92190
37355 37351
50251 50275
63547 63562
45725 45718
8654 8656
84452 84450
73562 73587
58481 58480
59544 59549
...

output:

0
99950
99949
99948
99947
99946
99945
99944
99943
99942
4994151711

result:

ok 11 lines

Test #156:

score: 0
Accepted
time: 219ms
memory: 58512kb

input:

100000 99950 50
70759 70811
26273 26306
67145 67249
60605 60633
56090 56113
33382 33405
87489 87557
91576 91585
49312 49359
63711 63723
72070 72182
12820 12845
48230 48277
92974 93083
51028 51062
2111 2192
43167 43215
70576 70619
5664 5751
42077 42109
57897 57894
25151 25284
70846 70871
95462 95527
...

output:

0
101939
104048
106262
108621
111000
113489
116125
119012
121943
124992
128093
131479
134939
138528
142629
146506
151208
155747
160501
166244
171558
177174
184360
192200
199478
207601
217175
225351
236535
250899
261567
278481
293029
312576
333520
359542
383317
425010
459782
503743
560814
637586
7205...

result:

ok 51 lines

Test #157:

score: 0
Accepted
time: 604ms
memory: 57388kb

input:

100000 340000 50
174 25995
185 65878
188 94080
157 47220
157 80856
174 14130
148 14103
201 7318
175 93034
148 23715
175 25773
174 21238
185 95262
186 50577
174 8146
148 75723
185 13338
175 11587
148 98900
185 10900
185 43986
174 25549
185 78702
168 83237
185 25587
147 62009
168 13225
174 59409
185 1...

output:

954
101050
101256
101665
102452
104286
108339
117050
135805
168713
223307
298571
402877
539895
713208
938449
1191132
1558472
2050566
2561856
3364129
4405409
5591202
7240301
9126020
11111136
14242867
17984416
19925942
26417099
34035356
38665586
48498022
48519306
79677872
68883213
99232143
90785823
11...

result:

ok 51 lines

Test #158:

score: 0
Accepted
time: 1732ms
memory: 64828kb

input:

100000 999998 50
1359 1428
2490 54101
2553 44163
2467 62748
2467 76244
2486 23182
2527 88764
2527 65639
2486 26324
2481 62812
2519 26248
2364 86328
2527 32483
2286 2307
2562 49665
2425 2448
2486 55485
2486 31491
2526 95060
2441 3156
2521 26003
2562 80068
2422 37013
2486 50196
2533 68663
1323 1356
15...

output:

0
99950
99949
99948
99947
99946
99945
99944
99943
99942
99941
99940
99939
99938
99937
99936
99935
99934
99933
99932
99931
99930
99929
99928
99928
99927
99947
99983
100178
100722
102028
105405
113089
126316
149115
185707
236925
309917
397589
508468
628716
770612
945275
1173072
1423955
1842953
2456503...

result:

ok 51 lines

Test #159:

score: 0
Accepted
time: 738ms
memory: 69364kb

input:

100000 1000000 50
23975 29989
23275 23308
38696 38709
88008 93030
54363 54389
2655 2658
79212 82398
45962 45985
78704 78714
16060 16107
61619 61667
66629 66678
63740 63794
93144 93167
82788 82809
64818 68830
99583 99594
94341 94385
67850 67878
37500 37523
54625 54653
39566 41740
23439 23510
50429 50...

output:

0
378460
2792510
3813195
6183218
6203233
7868767
9500425
13608144
2263979650
926122052
189400533
538683336
127517668
174371172
183008934
74748847
32681902
111624285
6977683
32155751
25880717
1484486
69982224
32405273
50989856
38503074
57224582
6961248
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 51 lines

Test #160:

score: 0
Accepted
time: 1805ms
memory: 68148kb

input:

99999 1000000 50
7393 7388
8910 8649
23195 39146
55242 55244
65938 65975
35715 35754
20507 20505
96749 96637
82776 82808
79272 79325
31210 31193
51643 51691
31032 31291
7166 7128
93353 92837
65750 66851
92421 92017
51114 51092
96926 96916
9807 9861
17902 17801
95487 95492
39819 40095
61921 61931
840...

output:

0
99949
99948
99947
99946
99945
99944
99943
99943
99944
99944
99944
99944
99949
99952
99957
99961
99969
99973
99980
99995
100127
100278
100909
105127
110914
115754
159317
158101
216086
329541
376047
758916
1233497
2419173
3814646
6466875
4052332
14946451
15351748
18468041
37748493
78823556
71711760
...

result:

ok 51 lines

Test #161:

score: 0
Accepted
time: 2057ms
memory: 68288kb

input:

99996 999998 50
22080 22102
82017 82098
66633 66584
20455 20443
45062 45061
18656 21449
23718 23764
4618 4553
18077 14964
24214 24946
15632 9503
45680 45688
1476 1455
46981 47058
20501 20548
55502 55895
95643 95696
26292 26258
93965 93978
79507 79532
94539 94532
65706 65681
43498 43422
81405 81440
7...

output:

0
99946
99945
99944
99943
99943
99942
99944
99944
99944
99947
99946
99946
99946
99947
99948
99951
99956
99965
99969
99973
99986
99998
100014
100030
100042
100070
100098
100127
100160
100189
100219
100256
100303
100360
100412
100481
100554
102960
106705
130471
207030
619836
1419221
5355801
12634117
6...

result:

ok 51 lines

Test #162:

score: 0
Accepted
time: 1829ms
memory: 68204kb

input:

100000 1000000 48
55953 55900
95900 95921
66998 67025
28492 28535
80989 80943
98161 98210
36737 37251
74222 74152
48826 48944
28958 28846
29556 29590
90713 90803
57815 57696
17603 17570
7790 7765
48779 48766
67344 67132
38091 38087
44356 44122
38482 38536
2469 2475
73910 73773
81877 81915
56501 5649...

output:

0
99952
99951
99951
99950
99949
99948
99947
99947
99948
99947
99947
99947
99947
99946
99945
99948
99950
99951
99952
99956
99960
99961
99965
99970
99975
99977
99990
99997
100029
100260
101676
108962
109090
167817
312873
524082
837246
2695226
6760588
12916845
31759302
2516540484
2419417874
0
0
0
0
0

result:

ok 49 lines

Test #163:

score: 0
Accepted
time: 1956ms
memory: 68220kb

input:

99997 1000000 50
50184 50004
45205 45202
1921 2270
34340 34171
70379 70890
57689 58049
11834 11916
85647 85655
67738 67499
88581 89057
64954 65022
77527 77292
11969 11377
48783 48770
69878 69874
44637 44571
36870 36097
48184 48724
78674 78274
21885 21945
6757 6367
39978 39887
72263 72255
32802 31768...

output:

0
99947
99946
99945
99944
99943
99944
99943
99942
99941
99940
99940
99939
99938
99938
99937
99937
99938
99937
99939
99942
99947
99950
99951
99958
99966
99969
99972
99978
99982
99987
99995
100004
100011
100024
100052
103595
104000
125808
702156
755707
20305860
34165561
18856143
19944866
56731631
4104...

result:

ok 51 lines

Test #164:

score: 0
Accepted
time: 2025ms
memory: 68220kb

input:

100000 999997 49
48163 48289
21457 21236
42509 50489
9632 9736
27467 27343
13555 13618
45559 45564
4968 4967
67395 67333
94902 94873
4720 5645
74860 74847
55260 55440
9351 9397
68446 68487
69262 69344
42680 42435
60495 61169
23979 24001
59723 58693
95838 95418
35224 35262
52262 52036
50762 51015
675...

output:

0
99951
99950
99949
99948
99947
99946
99947
99946
99946
99945
99944
99944
99944
99944
99943
99943
99942
99947
99946
99948
99948
99948
99950
99954
99957
99960
99962
99963
99966
99972
99974
99979
99982
99987
99994
99996
99998
100007
100014
102819
106780
178898
549578
2275833
34914715
68794767
12060634...

result:

ok 50 lines

Test #165:

score: 0
Accepted
time: 1898ms
memory: 68256kb

input:

99999 1000000 50
62683 62682
90609 90708
72398 72401
14015 14016
81101 81096
66545 66316
5735 5743
76755 76777
71572 71692
46688 46698
299 503
2189 2275
50941 50976
46334 46477
87511 87428
32713 32726
39293 39323
5242 5253
126 190
96151 96508
6690 6682
12236 12263
70173 70172
27936 27808
98616 99215...

output:

0
99949
99948
99947
99946
99945
99944
99943
99942
99941
99940
99940
99941
99942
99942
99941
99941
99943
99945
99949
99951
99955
99955
99956
99957
99959
99967
99980
99983
100094
100018
100026
100334
104427
113445
176479
3640936
3088110
990242
1581858
12924119
367463282
21175445
210766861
4369727007
0...

result:

ok 51 lines

Test #166:

score: 0
Accepted
time: 1965ms
memory: 68124kb

input:

100000 999999 49
94350 94444
7381 7327
56651 56650
73041 71359
70542 69710
50735 50876
30687 30880
59858 59874
60383 60599
90012 90064
17038 17047
91482 91275
32637 32567
53348 53326
25699 25697
35184 35252
41454 41413
2179 2193
74462 74470
74835 75371
63291 63112
43216 43477
31792 31770
67903 99940...

output:

0
99951
99950
99949
99948
99947
99946
99945
99944
99943
99943
99942
99941
99940
99939
99939
99939
99939
99939
99940
99942
99945
99945
99946
99950
99956
99958
99960
99961
99963
99963
99964
99968
99969
99971
99978
99984
99994
100382
104652
114013
311800
952782
10140672
36567851
130199337
329684127
448...

result:

ok 50 lines

Test #167:

score: 0
Accepted
time: 1966ms
memory: 68160kb

input:

100000 999997 50
43844 43854
64436 64523
15721 15890
43812 43688
31118 31037
67204 67180
12057 12054
31176 31350
83024 82922
66279 65956
79377 79365
52063 52173
95473 87599
37731 37678
19292 19282
16215 16205
81949 81829
61670 61731
97610 87236
45190 45184
34064 34134
13934 13984
86259 86258
39764 3...

output:

0
99950
99949
99948
99947
99946
99946
99945
99944
99943
99943
99943
99942
99942
99942
99941
99943
99944
99943
99942
99943
99947
99950
99952
99953
99954
99956
99957
99956
99961
99967
99989
100141
100857
102441
113620
147644
240503
603303
1251482
1736651
4119703
5058880
22001168
123538899
187983498
13...

result:

ok 51 lines

Test #168:

score: 0
Accepted
time: 1795ms
memory: 67632kb

input:

100000 1000000 50
35470 36103
93203 98248
34883 34920
63094 63083
27325 27133
26022 25997
60118 60159
24433 25184
47474 47653
47964 47898
49819 49767
8491 8073
22233 22411
70005 71594
95939 95783
78490 78491
22711 22698
61507 61532
38056 38193
76732 76375
30957 31021
2740 2206
14772 14542
86004 8567...

output:

0
99950
99949
99948
99947
99946
99945
99944
99943
99942
99941
99940
99939
99939
99938
99937
99936
99935
99934
99934
99934
99965
100303
100926
100770
102174
105044
115427
104923
133799
141707
202462
264733
461062
662071
996442
1582886
2018831
4447993
10509907
15280436
20613486
27866673
52602813
78715...

result:

ok 51 lines

Test #169:

score: 0
Accepted
time: 1694ms
memory: 67212kb

input:

79996 999997 50
32507 32479
4724 4741
26906 26957
27771 29331
17994 18094
17674 17662
13083 13110
31413 31339
49801 49945
18534 18259
23349 23356
69246 69834
67048 67021
31621 31596
56892 56887
71171 71179
28371 28433
66341 61191
27569 27685
6296 6408
22588 22599
930 864
22106 20462
9169 2420
49503 ...

output:

0
79946
79945
79944
79943
79942
79941
79940
79939
79938
79937
79936
79935
79934
79933
79932
79931
79930
79929
79929
79928
79928
79928
79928
79927
79931
79933
79934
79939
79944
79946
79951
79952
79957
79967
79974
79981
80080
82209
102964
162305
413423
1512355
2541808
8833769
24102947
36562443
1580697...

result:

ok 51 lines

Test #170:

score: 0
Accepted
time: 1755ms
memory: 66904kb

input:

80000 1000000 50
54566 55939
64751 65104
16002 16001
59347 59370
12034 11413
32556 31634
30914 31127
34982 34199
39179 39358
56890 54172
52559 52461
62863 63006
44615 44546
78178 78182
54300 53701
20890 20746
13981 14790
59497 59668
36042 36234
25358 25171
74145 74461
42952 43295
27915 28130
61280 6...

output:

0
79950
79949
79948
79947
79947
79946
79945
79944
79943
79942
79941
79940
79939
79938
79937
79936
79935
79934
79933
79932
79931
79930
79929
79928
79927
79926
79925
79924
79923
80155
81035
80771
90564
106451
124032
205188
309375
513864
1579087
1834449
2907445
5396358
22835517
23452961
18143972
148995...

result:

ok 51 lines

Test #171:

score: 0
Accepted
time: 673ms
memory: 63556kb

input:

100000 632645 50
60997 61014
32179 31107
42976 42770
76179 76199
22291 22284
89555 89693
66599 66633
95010 94777
35765 36132
23626 23619
58037 58042
12367 12374
51208 51223
17394 17395
64768 64611
78263 67865
17 67489
47247 49501
79769 79766
64603 64536
69209 69237
24025 24026
47749 47776
20002 1999...

output:

0
407061
394541
508417
556033
574540
597956
628831
634177
672002
681210
682233
688098
711051
731129
725016
747574
840101
895361
791709
1018626
931196
982222
1185332
1177575
1405605
1217840
2118841
2057626
2446083
3056839
4408976
3000166
2471949
2562454
2369923
3237618
4286339
5121369
5949448
4143655...

result:

ok 51 lines

Test #172:

score: 0
Accepted
time: 451ms
memory: 61692kb

input:

100000 485523 50
45298 42147
94452 94450
14695 14749
41723 41740
76783 76978
65670 65651
49039 49040
86741 86727
64235 62892
49204 49206
36700 36806
28349 28464
73201 73150
41245 40508
26379 23875
1768 1675
34340 34338
93818 93780
44959 44961
76575 76351
94402 94742
59349 59325
9067 9428
60704 60750...

output:

0
459500
435231
552575
586012
630866
652251
667520
699739
711141
731275
788142
799525
939011
1067083
1820818
4107346
896541440
1106615815
1627408956
305966575
225538443
35138687
32599846
46009259
93991930
233488954
148638815
227464470
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 51 lines

Test #173:

score: 0
Accepted
time: 634ms
memory: 63056kb

input:

99999 600747 50
62157 58205
44638 44616
57141 67631
65567 64853
28267 29295
95436 95428
49950 49570
31531 32030
99637 99440
75485 75474
47428 47961
70136 70158
71127 71126
47460 47449
79888 79853
9515 9528
75825 75821
88612 88704
52388 52513
72430 72454
88232 88217
10164 10102
53936 53634
65876 6487...

output:

0
284026
397667
476363
566756
589831
595684
627830
673337
687390
690904
704971
728456
734984
734784
747972
773356
837704
873812
2120648
2021940
2073230
9263969
3457432
16499538
9931397
11929309
3878211
7937875
9300459
21870467
232684883
34901202
19599440
39898737
26339444
11961187
122393995
10366940...

result:

ok 51 lines

Test #174:

score: 0
Accepted
time: 701ms
memory: 64224kb

input:

99996 637437 49
4138 4062
45215 45028
121 914
76893 76965
19568 17852
44377 43604
37959 37970
66206 66239
58759 57614
35807 36078
18385 18298
7057 7001
17555 17075
88139 88224
2643 2730
84133 83915
34498 34545
74624 74440
11691 11569
99558 99565
53181 53183
73186 73273
15332 15053
63601 63582
98924 ...

output:

0
177467
253205
317807
367402
398749
432083
458943
482572
498483
507393
524553
532591
555621
560934
581428
600516
658248
1031189
2657198
2845281
3755441
5586555
3873332
4566361
12518637
28073176
19130542
36776387
29067905
23427135
521907690
16983633
47514056
362035982
2762058966
2383877
3554979
2610...

result:

ok 50 lines

Test #175:

score: 0
Accepted
time: 489ms
memory: 62444kb

input:

100000 552571 50
82664 82701
13741 13776
24243 24244
76426 76670
1500 1176
30907 30936
94159 94444
57389 57278
58545 58289
13343 13339
36605 49887
92419 92418
89675 89674
82954 82766
49130 48997
78036 78061
33220 33219
35529 35530
56752 56754
38457 38458
21756 21760
22970 22987
80149 79871
57679 662...

output:

0
758678
615812
847385
866707
860829
837992
859475
870261
898590
906900
921014
895911
904345
913194
919862
944872
964101
960673
1268454
1249850
2794836
36165890
6627846
2871096
2033841
8805083
4910538738
894476
813344
5241170
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 51 lines

Test #176:

score: 0
Accepted
time: 567ms
memory: 63016kb

input:

100000 563337 48
27451 27662
40688 34974
71868 75416
21816 21811
55965 56175
90627 90472
51126 51195
26298 26276
83214 83208
81093 81087
65905 68758
72611 72878
49519 49488
69093 68913
20979 20871
41336 41348
42792 42785
91783 91847
49728 40793
4459 4461
68086 68097
75259 75533
47202 47375
65778 655...

output:

0
406335
406875
518125
564046
564000
605391
629339
642333
652841
660889
674352
688152
724835
738736
817599
869673
936574
1385538
1256788
2049583
2925808
3025606
2911221
4242819
2829665
14504130
2528434
8671288
5650098
18635780
3184382
12111185
10576363
3817137
17847842
18656593
18633669
14982055
195...

result:

ok 49 lines

Test #177:

score: 0
Accepted
time: 837ms
memory: 64676kb

input:

99998 738321 30
84089 84041
3084 91415
94223 94165
4551 4559
86838 84253
28487 28472
71959 71953
99053 99008
90908 90927
40982 40966
90748 89900
78410 78388
18354 18356
39165 41192
44492 44475
53187 53185
57353 57337
96049 96052
81269 81538
40831 40834
54751 53717
5733 5788
2120 65829
1821 1783
1987...

output:

0
149864
206344
215547
217340
278851
381079
350034
567082
701253
1251207
1443774
1811525
2288086
5381249
8802169
7791176
14446168
24571572
29417909
93538046
108182100
88043170
477299370
211708364
398951376
700588009
1705184902
448841201
416518
663825211

result:

ok 31 lines

Test #178:

score: 0
Accepted
time: 1040ms
memory: 66568kb

input:

100000 916764 29
95923 96348
60845 60948
8319 48610
42859 42776
73591 73670
29038 29863
53671 53610
57100 57952
20463 20341
38027 38028
90142 88995
8008 7676
2250 2477
97256 97317
37158 37353
13131 12710
83069 83165
71012 70872
24391 24338
52914 53237
89970 89901
68516 68527
10725 10677
89163 89533
...

output:

0
102241
103074
106772
118935
120897
146443
172571
186125
331018
439349
583070
762696
1346474
1345178
2299106
3684212
6374624
8878066
11264571
23442518
41673935
101637110
55924391
76849960
270131442
362811719
839578359
741330946
2445404604

result:

ok 30 lines

Test #179:

score: 0
Accepted
time: 2156ms
memory: 69596kb

input:

100000 999500 50
90659 90628
28173 28252
39657 39681
47392 47503
1328 1379
88772 88889
96557 96587
78955 79065
47347 47342
81812 81799
94848 95035
6289 6367
97986 97958
99634 99522
66662 66680
4246 4258
48582 48610
44191 44137
17738 17713
65471 65536
22470 22552
86785 86926
16101 16186
94196 94148
6...

output:

0
99950
99949
99948
99947
99946
99945
99944
99943
99942
99941
99940
99939
99938
99937
99936
99935
99934
99933
99932
99931
99930
99929
99928
99927
99926
99925
99924
99923
99922
99922
99922
99921
99921
99921
99920
99919
99918
99922
99923
99928
99933
99941
99945
3661939618
784573
869523805
458506129
0
...

result:

ok 51 lines

Subtask #9:

score: 1
Accepted

Test #180:

score: 1
Accepted
time: 938ms
memory: 61732kb

input:

99999 500000 49
8861 92315
18860 68957
24970 68840
31601 51945
44688 39847
79070 34993
12170 13894
75544 87259
6748 38760
98547 18652
9011 49641
40213 75883
89168 28210
62099 34092
25016 29026
10670 85648
55350 68113
3188 30844
2115 14445
765 9058
71650 23644
77821 96625
56700 12489
15671 31370
5736...

output:

117262
217079
217977
218458
218832
219000
219223
219930
220313
221197
220732
221161
221349
220896
223826
224184
223588
224732
225098
225376
225822
226406
228738
228014
229834
229049
229072
230944
229897
231830
232767
233314
234632
235472
236811
237374
239397
240295
240749
243254
243897
248955
250918...

result:

ok 50 lines

Test #181:

score: 0
Accepted
time: 1490ms
memory: 68160kb

input:

100000 981950 50
4506 4629
8092 8105
8663 8725
4036 4075
54008 54073
56079 56122
51180 51213
49280 49318
7902 7914
52816 52839
26570 26587
2918 2965
49401 49477
57951 57969
51963 51978
53939 54008
15 172
8070 8117
2799 2808
57546 57562
903 931
6354 6464
57057 57123
51947 52031
1761 1948
7629 7615
54...

output:

0
101658
103431
105196
107055
108983
111077
113218
115372
117847
120437
123064
125914
128654
131927
135011
138525
142576
146321
150031
154720
158980
164413
169621
176074
182198
189561
196663
204475
213816
222392
232731
246427
257883
274015
290655
311134
333982
357021
389231
426238
476415
530870
5991...

result:

ok 51 lines

Test #182:

score: 0
Accepted
time: 423ms
memory: 56284kb

input:

100000 249997 50
143 77770
147 33910
147 46178
215 13316
84 86547
144 184
84 43946
199 5880
188 20553
84 72089
215 18022
147 55031
199 46556
143 83198
188 89229
84 97087
199 33555
215 81643
128 25103
199 33495
84 52592
215 2335
199 46479
84 50939
215 87280
215 29303
85 10045
84 37343
215 22302
186 3...

output:

3787
104942
107472
112679
124629
147609
194484
269653
390687
571352
784211
1131156
1599656
2242365
3055581
4276413
5973309
7994349
11203152
13853140
20023142
23973173
33378984
37377398
46795003
50714348
55552400
59719081
71527681
99867200
92061811
96099015
116952470
109114774
123555219
170473751
162...

result:

ok 51 lines

Test #183:

score: 0
Accepted
time: 886ms
memory: 58920kb

input:

100000 499997 50
72 61838
191 1187
168 95693
168 40873
63 29385
151 876
142 9170
175 25860
180 24889
179 96054
92 28618
184 12709
72 66113
168 67980
197 6642
72 44017
92 5841
136 53123
178 80099
208 57575
92 21327
72 85668
63 80541
72 96660
72 83377
178 81431
72 73187
168 2599
63 42773
197 34412
92 ...

output:

83
100035
100035
100035
100039
100044
100055
100064
100113
100241
100591
101618
104126
109739
120736
140767
173916
221802
284134
363839
453829
563718
671506
817784
999174
1194646
1472700
1695161
2136033
2576921
3109074
3849389
4407838
5555460
6489246
8259618
9746968
12001599
14221317
15182570
204482...

result:

ok 51 lines

Test #184:

score: 0
Accepted
time: 727ms
memory: 69552kb

input:

100000 1000000 50
91675 91783
36853 36870
62251 62320
56642 56751
49487 49527
67635 67721
30861 30994
37337 37409
66420 66539
96678 96717
35847 35858
28516 28545
60450 60523
23244 23405
83195 83197
79217 79355
5279 5441
66228 66233
48729 48824
75035 75075
74136 74171
56161 56190
61250 61252
14475 14...

output:

0
1452459
10224529
12887382
21706350
448887691
409892011
154997175
335642017
1123395362
254912001
1118823747
58685862
221648925
8204261
90909652
75381313
74955251
57546553
405471398
109427286
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 51 lines

Test #185:

score: 0
Accepted
time: 747ms
memory: 69332kb

input:

100000 1000000 50
82038 82087
32041 32077
5329 6300
48270 51808
1585 1582
58153 58171
36436 39603
26211 26212
59922 59926
94062 94074
90133 90148
97052 97061
84658 84671
86618 86624
69462 70304
14572 14578
92651 92657
1855 1852
15171 15193
28004 28032
24584 24570
31713 31718
96603 96620
88811 88810
...

output:

0
250825
1405219
2307005
3667855
3880716
5610432
814424083
587628396
198650315
2234970913
386286211
33951785
90438308
116338687
153998520
152752679
4323422
15265982
8106470
297341
11694334
7901791
15618471
7910235
23669675
31708481
73855256
8137818
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 51 lines

Test #186:

score: 0
Accepted
time: 2001ms
memory: 68236kb

input:

100000 999997 50
8326 8301
63927 63910
24668 24678
46764 48078
32382 30683
89134 89237
44668 44748
90597 90584
81171 81178
43839 42629
394 54
99188 98986
8266 8271
8378 5599
28118 28098
68756 68754
37398 37415
79030 78824
6670 6699
19309 19551
12832 12878
25458 25398
15000 15161
43300 43442
55246 55...

output:

0
99950
99949
99948
99947
99946
99945
99944
99943
99942
99941
99942
99941
99942
99943
99943
99945
99949
99952
99959
99968
99974
99980
99990
99998
100013
100027
100048
100064
100080
100097
100122
100276
101328
106575
115861
146634
268579
649736
974928
2090890
5599599
15970446
16907370
22855939
833330...

result:

ok 51 lines

Test #187:

score: 0
Accepted
time: 1994ms
memory: 68188kb

input:

99997 999998 48
68730 68708
98440 98310
77490 77707
29867 29852
57876 57869
97856 97846
87694 87709
52662 52555
40115 40300
37561 37553
99275 99343
16000 16028
73764 73718
66720 66722
860 954
97205 96576
36799 36812
10063 10109
32 6984
53025 52991
18693 18710
23891 23829
48969 49005
51915 51906
4765...

output:

0
99949
99948
99948
99949
99948
99947
99946
99946
99945
99945
99949
99948
99949
99949
99952
99954
99959
99962
99966
99974
99984
99991
100003
100015
100026
100054
100088
100124
100165
100199
100234
100284
100335
100389
100455
101168
102576
118895
460088
525359
2149365
11257919
35419697
42587227
19803...

result:

ok 49 lines

Test #188:

score: 0
Accepted
time: 1686ms
memory: 68232kb

input:

100000 999999 50
38722 38695
94487 94670
55780 55761
8263 8378
11031 11083
34561 34546
4360 4143
68546 68552
32691 32549
52408 52410
64446 64468
38249 38317
99211 99233
79659 79655
28433 28277
7133 7090
68915 68898
11290 11307
2062 2183
79002 79051
66292 66178
19566 19813
61451 61493
82440 82357
894...

output:

0
99950
99949
99948
99947
99947
99946
99947
99947
99946
99946
99948
99949
99949
99952
99962
99982
100097
100113
100196
100493
105363
107579
115822
143006
136915
205406
340838
1844412
914950
1948360
4448660
11280701
51695522
90556017
2247956445
187610924
16519183
1061621
83323221
2222349080
70387086
...

result:

ok 51 lines

Test #189:

score: 0
Accepted
time: 2047ms
memory: 68092kb

input:

100000 999995 50
15115 14792
21958 21953
16236 16096
34913 34922
54510 54290
27526 27514
14557 13851
20411 20385
83481 83484
20310 20320
53430 53390
25708 26139
96954 96829
51259 51382
89221 89361
42266 42299
8571 8532
59314 59309
7045 6869
98957 98924
45981 45967
95027 95039
24671 25062
19683 19762...

output:

0
99950
99949
99948
99948
99947
99946
99945
99944
99943
99942
99942
99942
99943
99944
99946
99946
99947
99947
99951
99954
99958
99960
99960
99964
99969
99974
99977
99980
99981
99991
99995
100005
100012
100022
100032
100052
100054
100215
101799
124232
272244
690047
1533747
3941969
15280227
42804994
8...

result:

ok 51 lines

Test #190:

score: 0
Accepted
time: 1971ms
memory: 68092kb

input:

99997 1000000 50
72255 72245
5064 5058
23342 23620
83654 83327
80752 80783
23246 23315
32390 32428
82393 82396
4518 4428
86294 86303
5575 5565
38781 38519
23542 23489
50919 51407
797 858
54042 54034
93973 94365
19149 18495
82956 79071
8990 8995
46159 46104
57364 57372
54311 54271
54875 54971
61905 5...

output:

0
99947
99946
99945
99944
99943
99942
99941
99940
99939
99939
99938
99937
99936
99935
99935
99936
99939
99938
99940
99939
99939
99944
99947
99951
99953
99953
99956
99963
99968
99968
99971
99972
99979
99995
100002
100011
100163
101655
113967
146624
1369421
2570941
6375714
74763073
170413294
285326590...

result:

ok 51 lines

Test #191:

score: 0
Accepted
time: 1913ms
memory: 68232kb

input:

100000 1000000 49
51396 51366
11216 11337
59715 60100
7016 7037
82747 82740
43088 4291
11892 11898
71655 71603
84843 84831
10780 10681
77519 77532
37539 38068
91989 91851
53595 53236
78225 78214
56493 56487
66172 66246
22756 22366
68302 68394
63190 63209
10132 9997
74772 74837
62754 62814
80740 8065...

output:

0
99951
99950
99949
99948
99947
99946
99945
99944
99944
99944
99943
99942
99944
99943
99943
99943
99944
99944
99945
99945
99948
99949
99952
99956
99958
99966
99973
99987
99992
99993
100003
100015
100025
100031
100499
109019
207902
178183
438072
3481760
10545456
17683872
180814886
743344159
84458672
...

result:

ok 50 lines

Test #192:

score: 0
Accepted
time: 1971ms
memory: 68084kb

input:

100000 1000000 48
14755 14766
80267 80027
68744 68761
73964 73972
93960 93915
88259 88250
90461 90487
17518 17338
68053 67745
96870 96880
47798 47756
46467 46472
90042 90064
77578 77345
48738 48965
56477 56399
69172 69171
931 1129
51805 51779
15390 15613
84684 84528
14347 14402
82263 81425
27462 273...

output:

0
99952
99951
99950
99949
99948
99948
99948
99947
99946
99945
99944
99945
99944
99944
99945
99944
99945
99947
99946
99947
99950
99951
99953
99956
99958
99961
99966
99971
99975
99978
99984
99990
99998
100006
100017
100034
100041
100099
100721
418907
484399
1662859
21037779
905460821
4062286919
0
0
0

result:

ok 49 lines

Test #193:

score: 0
Accepted
time: 1875ms
memory: 67872kb

input:

99998 999995 50
70737 70640
63267 63231
24848 24914
54189 53370
78147 78482
1336 908
73590 73616
15718 16055
62544 62405
16330 16403
83659 84027
58573 58277
44304 44341
58456 58457
91385 91131
70370 70406
68750 68472
71252 69366
6479 6513
81377 81292
14065 13977
3978 3901
13175 13181
18686 18248
621...

output:

0
99948
99947
99946
99945
99944
99943
99942
99941
99940
99939
99938
99938
99937
99937
99937
99937
99940
99940
99939
99939
99938
99938
99939
99940
100218
100881
102921
102071
111602
139199
150250
286800
315841
466242
717221
1436198
2774153
4584249
9569678
12579242
22322461
34471412
71164081
72126983
...

result:

ok 51 lines

Test #194:

score: 0
Accepted
time: 1843ms
memory: 67488kb

input:

100000 1000000 50
90714 90983
10579 12409
56318 56231
96976 96697
59062 58936
80785 80514
22628 22246
97167 96686
3383 3404
52092 50828
75210 75760
50927 50895
47996 48611
33065 33227
74091 74164
98234 98040
66522 67450
24365 26179
68747 69011
24437 26828
93160 10906
82126 82089
43812 44048
96215 95...

output:

0
99950
99949
99948
99947
99946
99945
99944
99943
99942
99943
99942
99941
99940
99939
99939
99938
99937
99936
99938
99937
99936
100062
101029
100554
100893
110191
108613
123422
153707
158425
196190
354478
318398
628961
927786
1358643
3266256
3246459
4566338
10919011
33876172
24832112
40936519
314049...

result:

ok 51 lines

Test #195:

score: 0
Accepted
time: 1759ms
memory: 67368kb

input:

80000 999995 50
60958 60949
24019 23868
65665 65590
76945 76981
2059 2099
16120 15802
68596 69806
47933 47945
12098 12096
3005 2996
63295 50116
32967 33040
8800 8826
37318 38627
3051 6232
76251 76129
19070 18864
31474 31456
28222 28223
77253 77164
7211 7178
17430 16878
24449 24346
43644 43828
26063 ...

output:

0
79950
79949
79948
79947
79946
79945
79944
79944
79943
79942
79941
79940
79939
79938
79937
79937
79936
79935
79935
79934
79933
79932
79933
79932
79931
79931
79930
79930
79931
79930
79929
79931
79930
79931
79932
79933
80059
80607
84060
129456
164984
765087
2273566
4745539
27773057
33064094
75120030
...

result:

ok 51 lines

Test #196:

score: 0
Accepted
time: 493ms
memory: 61244kb

input:

100000 455061 48
53797 53901
64321 64163
52644 54336
23469 23555
43108 43102
21906 21914
50581 50584
86322 86344
88401 88238
45471 45451
39071 39048
71628 71623
89810 93579
61361 61428
37313 37314
82226 82223
17265 17091
62617 62612
97900 97522
59217 59260
55386 33404
17133 17132
30671 30497
53636 5...

output:

0
245437
329211
380585
448957
497738
517647
570756
591324
652040
696717
711571
861489
1106154
917251
1365422
1182946
1272276
4795616
2268827
2203714
1632363
3006455
2966474
3278918
2862838
4160296
2492159
7117274
6075024
7269498
7698259
7753612
20620057
15606053
33054266
13514840
11308055
224338084
...

result:

ok 49 lines

Test #197:

score: 0
Accepted
time: 581ms
memory: 63004kb

input:

100000 586969 49
58833 58874
85862 84837
61848 61868
51 58
91702 91685
34073 33972
45643 45734
86198 86161
1194 1177
39226 39180
13 33836
64646 65370
30404 30459
6828 6885
5031 5043
115 52716
90319 90335
23223 23297
73971 73947
3866 5247
8689 8709
81438 81217
17902 17917
9675 9568
62561 62272
21196 ...

output:

0
247304
366527
444719
533871
574771
577546
616594
656283
686263
702710
719493
742853
865771
779619
1470328
841313
873303
849792
1528461
2087726
976192
1278394
1201300
1057777
1072423
1181930
1332758
1443214
1535369
2022875
2075019
1675111
1867778
4756198
5391186
7061870
2426791
3789011
4471256
5457...

result:

ok 50 lines

Test #198:

score: 0
Accepted
time: 607ms
memory: 64076kb

input:

99995 650196 50
45439 45417
42834 41883
7453 7439
5809 5787
26759 26764
28215 28287
2027 2082
45126 45117
8039 8123
39323 35253
68177 68174
79441 79439
10461 11366
71358 71242
87817 87264
35559 35526
11423 11494
40365 41115
38137 38122
19781 19617
14336 17641
52853 52936
51134 51211
70325 70379
2167...

output:

0
413531
397179
496965
517520
550387
580246
582153
601175
603407
617522
623530
619044
633279
643162
641132
743459
792903
846356
859873
1270194
1314915
1413206
3378903
2681145
12093209
19976812
17270836
52898831
367157870
2285067324
2060198151
907686
388675
545931
431365
655942
494896
703704
432921
5...

result:

ok 51 lines

Test #199:

score: 0
Accepted
time: 521ms
memory: 62456kb

input:

100000 556508 50
88575 88755
68442 68605
92390 92437
93943 99173
23920 23399
14086 14067
389 396
33873 33875
28771 28753
43436 67376
73079 73049
52990 52504
41865 41935
69500 69733
93920 93853
78074 78221
8168 7997
93609 95389
19564 21318
39774 39854
78661 78880
28912 28932
26687 26753
12960 14087
2...

output:

0
443691
503136
614743
754873
764677
753244
745650
751722
815719
858361
857994
844912
842088
861423
869071
871649
927053
920607
1447601
1061237
2092290
1508430
1470082
1838050
7951503
11759815
14365283
15011565
10294421
4956905
4397461
160316453
520570816
3618742478
1726175
8195003
2530055
3097311
9...

result:

ok 51 lines

Test #200:

score: 0
Accepted
time: 543ms
memory: 63676kb

input:

100000 633314 50
69983 69990
27387 29794
79323 77449
53571 53563
96722 96359
97501 97614
97883 97885
68056 68034
42572 42562
19522 19779
54496 54265
57744 57312
81973 81977
5317 5266
37983 37986
79009 78827
3769 3774
15114 14901
61815 61856
4225 3807
53087 61855
62345 62629
46851 47139
37173 37121
6...

output:

0
274419
361628
435517
496007
509290
542832
587951
585133
610097
629927
637465
640496
656087
654665
692178
744593
735365
784736
1000041
1020647
1083607
584040578
3202571
1257946
13343675
9919076
6231414
5137902
10510297
163294801
13166610
53980591
7369074
40710152
6584361
33123683
82683806
39745539
...

result:

ok 51 lines

Test #201:

score: 0
Accepted
time: 493ms
memory: 63272kb

input:

100000 594135 50
20569 20505
59548 59056
36981 37043
12350 12575
99571 99506
51288 51296
90579 90340
34689 34715
69460 69450
87489 87315
24424 24367
99953 98843
15707 15579
88194 88189
68349 68326
52815 52918
52439 52635
47860 47861
27564 28232
30936 30957
78994 78929
2083 1964
18490 18527
67940 679...

output:

0
463551
424052
544971
593686
629284
664811
676660
701001
709731
721467
726428
723635
771974
931263
877652
880736
1185200
1099701
2224661
4586737
4237461
4672565
12164862
4312509
35610579
48456654
19087741
67469665
121347975
286578649
970798575
2469688433
113583182
75208261
352551877
389145036
0
0
0...

result:

ok 51 lines

Test #202:

score: 0
Accepted
time: 486ms
memory: 61528kb

input:

100000 483887 50
34138 34260
59659 60208
20725 20750
14946 15946
71299 71300
50884 50907
49385 49341
34636 33840
25849 25696
22524 19882
31415 31711
38904 38905
18260 17813
62881 62909
8459 8454
54984 55078
74471 74376
35956 35935
25065 25097
82144 82474
79482 79535
89581 89580
55617 55727
76977 768...

output:

0
597637
530177
682091
711737
702377
738399
758072
773170
766451
822365
798903
810671
836762
979350
917541
1022825
1159112
1452306
1529561
2919499
4363891
1405187
2266832
6414774
8630154
2436480
2880769
3076563
4375706
5514212
2222387
2765170
10245556
6819038
24299067
21040453
8712811
28927883
12511...

result:

ok 51 lines

Test #203:

score: 0
Accepted
time: 938ms
memory: 67228kb

input:

100000 902962 23
38412 38411
49436 49420
18284 18313
87980 88086
35847 35703
35989 35987
86084 86078
13197 13148
4790 4772
99151 99277
2518 2502
25905 25909
53062 52995
81483 81492
37582 37618
38439 38420
28935 28929
48115 48134
85963 85969
40996 40899
18975 18964
19824 19828
47373 47367
37782 37792...

output:

0
100742
101525
102983
118772
181281
296148
211182
295394
402683
1077561
1348850
18312029
25342238
18916797
34170280
37018369
156220219
335435871
143131913
589015463
696642964
751183465
2188123524

result:

ok 24 lines

Test #204:

score: 0
Accepted
time: 987ms
memory: 66476kb

input:

100000 870589 30
5603 5610
14264 14357
83939 84208
21391 21576
20746 20737
2332 4506
90581 90590
55378 55435
79317 79290
8838 8843
84504 98651
28938 28857
58279 58354
8215 8172
27761 27747
14309 12238
25770 25786
58105 58107
9205 9020
4964 4918
67153 67233
39798 39816
74286 74637
10449 10990
75972 7...

output:

0
119407
128301
131371
130265
144958
147059
198521
324094
328252
457769
480669
797982
1305361
1519838
2320690
3889733
5985644
5491802
21024655
23038667
18304860
60517229
62245238
130350266
170921732
886767687
417503169
1036932877
2145542339
0

result:

ok 31 lines

Test #205:

score: 0
Accepted
time: 1375ms
memory: 67524kb

input:

100000 1000000 50
51 53
51 59
51 62
51 76
51 98
51 140
51 212
51 404
51 781
51 1554
51 3120
51 6104
51 12400
51 24638
51 49120
53 61
53 64
53 84
53 99
53 142
53 213
53 406
53 798
53 1558
53 3121
53 6108
53 12404
53 24643
53 49133
59 61
59 65
59 85
59 106
59 143
59 215
59 411
59 799
59 1559
59 3123
5...

output:

5
99952
99953
99950
99953
99962
100010
100065
100152
100363
100667
101121
102199
102984
104333
108036
110479
113988
124515
132882
152540
199519
198044
263613
530172
480303
555012
1835691
1356310
1590891
7161818
3461032
3698856
21446408
12197335
8633411
28105444
53985176
36743009
58966569
71600001
10...

result:

ok 51 lines

Subtask #10:

score: 1
Accepted

Test #206:

score: 1
Accepted
time: 351ms
memory: 59412kb

input:

99998 333333 48
73739 93660
91007 91516
66213 58419
14322 20532
23379 45804
68919 29793
96370 75509
32761 33718
67640 41557
44076 22311
98483 81319
19053 94794
53747 71410
37756 45486
80813 7949
77662 37115
50333 69157
83060 39070
40304 52327
88393 62810
45164 62483
34608 2510
86417 91245
42491 9720...

output:

392726
496843
510793
513104
525407
545652
547987
565139
579428
598815
611150
633631
645413
677053
687964
721394
762068
791485
823290
859638
902351
958839
1027764
1071059
1161545
1235134
1301406
1450592
1569720
1707049
1798996
2059151
2292976
2522353
2757796
3193482
3566053
4245241
4867572
6244653
69...

result:

ok 49 lines

Test #207:

score: 0
Accepted
time: 720ms
memory: 64948kb

input:

20050 1000000 50
8860 8905
19077 19132
4744 4779
11319 11338
535 592
3999 3992
15598 15665
9250 9340
16619 16658
8565 8609
19252 19266
7723 7754
17649 17675
15501 15502
7376 7406
8043 8157
17192 17425
6464 6456
3793 3808
16202 16213
12729 12779
5995 6019
6496 6585
14096 14154
1858 1866
16884 16920
9...

output:

0
20000
19999
19998
19997
19996
19995
19994
19993
19992
19991
19990
19989
19988
19987
19986
19985
19984
19983
19982
19981
19980
19979
19978
19977
19976
19975
19974
19973
19972
19971
19970
19969
19968
19967
19966
19965
19964
19963
19962
19961
19960
19959
19958
19957
19956
19955
19954
19953
19952
1990...

result:

ok 51 lines

Test #208:

score: 0
Accepted
time: 518ms
memory: 56812kb

input:

100000 300000 50
166 60201
152 23372
130 61693
173 60521
166 61595
173 70666
131 68522
166 85127
166 71167
173 55557
166 6542
173 94420
14 28282
134 33907
166 94838
128 33282
165 43059
130 15721
174 64216
174 72465
166 55272
173 72162
166 85698
60 6557
165 44697
130 13625
173 84105
60 80295
166 7606...

output:

1801
102125
102713
104012
106798
113144
126457
152672
197706
270793
370148
504800
694463
925768
1254514
1642125
2217404
2978219
3993522
5139413
6934313
8584055
11310445
14527650
18444109
23947080
33423743
34616917
42069056
55712623
66941645
73006505
82462703
112749503
94629960
121471349
121732096
14...

result:

ok 51 lines

Test #209:

score: 0
Accepted
time: 1315ms
memory: 61068kb

input:

100000 699999 50
199 16916
150 40531
201 1974
197 51812
182 68689
181 88062
114 11271
150 20864
150 61122
180 80814
144 80165
201 69107
150 69237
158 15702
137 53714
181 86808
114 96750
150 82277
158 79469
183 9516
183 43336
181 41101
182 23399
181 94483
210 19736
182 48086
143 12327
201 48108
103 4...

output:

2
99952
99951
99950
99949
99948
99947
99946
99945
99944
99943
99942
99941
99940
99939
99940
99948
99972
100076
100428
101101
103514
108036
117789
132794
158812
198537
251528
312712
392377
468469
568323
667750
781345
903115
1077263
1263832
1537349
1686617
2122644
2551696
3053688
3745770
4612166
59025...

result:

ok 51 lines

Test #210:

score: 0
Accepted
time: 703ms
memory: 69392kb

input:

100000 1000000 50
75136 75132
49081 49096
35547 35572
8989 9040
68352 68364
12113 12142
69330 69341
57053 57058
29759 29769
96404 96418
82200 82286
25243 25250
29042 34655
27013 27029
43656 43680
21391 21432
59330 59404
93734 93735
47200 47213
18283 18300
52644 52666
60372 60385
54062 54096
77722 77...

output:

0
587459
4619334
5756429
9187910
9784601
12522665
17493932
26527671
504853180
263055469
2667712787
294557018
533326459
184688485
10251323
29596492
38012739
47224827
28753514
56847923
38231463
10216291
19545658
10204788
114077680
47498104
9917024
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 51 lines

Test #211:

score: 0
Accepted
time: 1723ms
memory: 68252kb

input:

100000 999996 50
20841 20803
45884 29140
63120 63134
27663 30445
27955 27756
96160 96154
93646 94511
4434 4554
68879 69244
59674 59648
97336 97360
60211 60206
42762 42777
54996 55020
7784 7752
12746 13214
27234 27553
99218 11682
26343 26326
36351 36293
82012 82026
36246 36252
94232 94287
98147 98211...

output:

0
99950
99949
99948
99947
99947
99946
99948
99950
99951
99955
99955
99958
99965
99975
100227
100185
100155
101390
101206
102823
103920
108127
135320
139088
172930
270546
322284
464922
780689
902866
917840
1125312
3479924
3531368
15656230
15644197
32905298
14402634
14010434
11951206
41884836
12012879...

result:

ok 51 lines

Test #212:

score: 0
Accepted
time: 2043ms
memory: 68128kb

input:

100000 1000000 50
2202 2453
14423 14422
93356 93507
71374 71375
2725 2729
57404 57402
28856 28860
91088 90944
50280 50298
29652 30773
31697 28421
357 10433
42286 42319
19610 19623
86906 86924
95577 95575
66209 66249
62016 61565
17838 15246
46223 46194
51925 51911
21705 21871
65517 65374
31143 30895
...

output:

0
99950
99949
99948
99947
99946
99947
99947
99947
99946
99948
99949
99948
99950
99950
99952
99953
99954
99960
99967
99968
99981
99987
99996
100014
100022
100034
100054
100067
100087
100103
100132
100153
100196
100220
100259
100422
101150
111567
131694
267350
496756
2584431
5408035
13177007
27930212
...

result:

ok 51 lines

Test #213:

score: 0
Accepted
time: 1989ms
memory: 68228kb

input:

99996 1000000 48
39391 38899
99503 99485
22687 23176
74339 74344
63732 63703
9875 9961
8161 8165
74345 74716
60519 60485
85651 85421
29782 29677
73943 73912
97805 97347
31868 31853
51104 51090
11733 11675
84000 83956
50720 50608
49758 49694
35220 35198
88657 88670
88247 88166
74520 74613
78549 78548...

output:

0
99948
99947
99946
99945
99945
99944
99943
99942
99941
99940
99941
99941
99940
99940
99942
99946
99948
99952
99959
99963
99968
99980
99987
100005
100017
100031
100049
100075
100108
100143
100181
100225
100266
100307
100361
100404
100460
100614
107692
125450
275611
1014009
4320242
17877985
71817316
...

result:

ok 49 lines

Test #214:

score: 0
Accepted
time: 1885ms
memory: 68224kb

input:

100000 1000000 50
65677 63675
45487 46086
76286 76262
29298 29285
8258 8289
68953 69559
57210 57168
38620 38391
29335 29445
91096 91191
38998 39093
62039 62021
7296 7295
56799 56621
8355 8331
66548 66659
86160 86047
77363 77327
18202 18226
66674 68042
11050 11112
71388 71368
5726 6445
15176 14921
48...

output:

0
99950
99949
99948
99948
99947
99946
99945
99944
99944
99945
99944
99943
99943
99943
99943
99944
99944
99946
99950
99951
99951
99952
99958
99964
99970
99973
99979
99986
99995
100002
100121
100773
101052
116777
143099
267440
605937
915110
2716636
6648013
8355782
22438675
88169513
275392765
297547921...

result:

ok 51 lines

Test #215:

score: 0
Accepted
time: 2010ms
memory: 68248kb

input:

100000 1000000 48
42576 42589
75198 75160
42763 42765
5617 5777
63029 63261
87463 87352
75195 70363
88569 88600
75888 76998
71059 71695
48575 48588
72585 72450
10078 12530
87651 96139
1944 1938
22273 22402
25122 24991
95127 95261
22146 22596
76353 76402
85537 85754
97549 97606
71625 71883
4663 4630
...

output:

0
99952
99951
99950
99949
99948
99947
99946
99945
99944
99943
99942
99941
99940
99940
99939
99940
99939
99938
99938
99938
99938
99940
99944
99945
99948
99952
99952
99956
99957
99961
99965
99969
99975
99980
99988
99993
99999
100181
101228
135309
244030
1804962
6974639
47255148
86844705
183793534
4664...

result:

ok 49 lines

Test #216:

score: 0
Accepted
time: 1723ms
memory: 68228kb

input:

99997 1000000 50
68643 68534
23444 23681
14137 14203
88258 88209
20817 20790
21201 21363
14322 14198
31746 31989
88461 88442
69176 67379
30209 29673
62645 62678
79529 81640
40484 40478
10223 10242
18515 18078
14088 14097
91475 91550
24571 24569
82956 82907
80338 80326
38350 38217
3970 3911
22245 222...

output:

0
99947
99946
99945
99944
99943
99942
99941
99941
99940
99940
99944
99943
99943
99944
99943
100011
100253
100349
114568
108510
107317
111055
118595
130934
192533
446331
346712
500584
676877
1632661
6840737
3742294
9984279
5230964
19044761
41609748
19828741
4882183418
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 51 lines

Test #217:

score: 0
Accepted
time: 2005ms
memory: 68252kb

input:

100000 999996 50
61043 61117
56301 56208
77944 77932
40763 40383
44749 44688
35806 35756
74174 74134
37602 37696
48739 49052
62814 62755
87711 87829
63344 63425
95992 96134
93616 93732
85480 85512
32079 31131
24126 23824
47811 47802
63703 63694
69308 61269
13302 14013
60796 60787
67361 67392
34433 3...

output:

0
99950
99949
99948
99947
99946
99945
99944
99943
99942
99942
99941
99940
99939
99939
99938
99938
99939
99941
99940
99941
99940
99939
99940
99942
99944
99952
99954
99960
99960
99961
99964
99967
99975
99983
99990
99999
101487
102640
100974
117517
196071
1757801
799958245
2994804
23352337
2820502799
1...

result:

ok 51 lines

Test #218:

score: 0
Accepted
time: 1778ms
memory: 67472kb

input:

100000 1000000 50
38003 38006
76091 76057
2803 2435
66310 66285
481 475
78120 80253
701 898
21816 28578
26732 27089
77674 78450
741 12753
46178 46156
30829 31470
28990 28403
58054 57196
4762 88047
23424 23397
61319 61475
72818 72749
89812 89911
90054 90070
58822 64591
56193 56987
25709 25631
45664 4...

output:

0
99950
99949
99948
99947
99946
99945
99944
99943
99942
99941
99940
99939
99939
99938
99937
99937
99938
99937
99937
99936
99936
99935
99951
100602
101317
102456
109974
116806
134325
178829
261680
401100
639749
890528
1508512
2610399
5780993
8147419
8353173
13374955
15048062
72675628
79174099
5976692...

result:

ok 51 lines

Test #219:

score: 0
Accepted
time: 2012ms
memory: 67692kb

input:

99998 1000000 50
93552 93563
15102 15135
37903 37751
74535 74515
18248 18258
59583 60335
59399 59404
47539 47480
24821 24692
19321 20000
81743 81445
17962 18083
94723 95017
54632 53727
40837 39654
63243 63532
89727 89812
7876 7463
85857 84345
75012 72974
90230 89943
65480 65518
54640 54644
59983 599...

output:

0
99948
99947
99946
99945
99944
99943
99942
99941
99941
99940
99939
99939
99939
99939
99940
99939
99938
99938
99938
99937
99937
99938
99939
99938
99938
99937
100057
100163
100683
101449
106648
115614
153427
337056
255925
378747
813691
1610521
2196176
4288262
8550136
10088565
20473063
43437419
720224...

result:

ok 51 lines

Test #220:

score: 0
Accepted
time: 1805ms
memory: 67408kb

input:

100000 999997 50
74570 73925
69894 68740
5633 5686
17213 51767
74923 74922
33724 33715
81182 81178
23056 23102
42609 42608
23150 23071
48909 48970
82531 82200
89998 90000
62856 62332
11297 11380
84859 84641
15714 15706
90806 90843
86373 86400
31871 32248
98747 98329
86298 85216
6957 6890
25687 25432...

output:

0
99950
99949
99948
99947
99947
99946
99945
99944
99944
99944
99944
99943
99943
99942
99942
99941
99973
99971
100142
100778
102888
106885
112425
121360
147015
196908
209002
345697
321899
442188
742767
1141400
1613876
1696092
3039070
4999733
6005369
10969564
11808882
14270111
57507835
33694898
100776...

result:

ok 51 lines

Test #221:

score: 0
Accepted
time: 1868ms
memory: 67300kb

input:

79998 999997 50
34013 33982
53434 53615
74584 74541
8009 7900
74579 74542
79677 79692
4331 4329
56282 56063
73198 73201
5480 6275
21056 20960
3204 3200
42111 42078
25177 25153
15465 15206
41978 41902
16727 16852
56286 56280
42938 42939
943 1140
11879 11808
15444 15036
63341 63322
78469 78416
29742 2...

output:

0
79948
79947
79946
79945
79944
79943
79942
79941
79940
79939
79938
79937
79936
79935
79934
79933
79932
79931
79930
79929
79928
79928
79927
79926
79926
79925
79924
79923
79925
79924
79925
79924
79923
79922
79922
79976
80445
83223
90857
132053
380670
1574534
13360466
77127551
1277885490
318579033
150...

result:

ok 51 lines

Test #222:

score: 0
Accepted
time: 711ms
memory: 64300kb

input:

100000 666460 50
77394 77397
19449 19934
59525 59536
96417 96482
85875 85507
40002 40005
65588 65626
13394 13247
32895 32903
58754 58865
40698 40701
80316 80312
75540 73420
34891 34860
20248 20208
30759 31802
55206 55183
61613 59906
5891 6054
69740 69741
27875 27873
34629 34444
55509 55507
44348 442...

output:

0
321833
340148
416169
450350
483134
512403
535621
545472
564029
579720
587834
617237
652671
637411
646688
730246
759676
903200
858447
1010212
1991881
919725
864946
1082932
1063522
1135494
2113742
1681533
2388386
2818073
1969042
11208232
15793311
5382724
70414748
20758572
7275785
6193746
11254908
74...

result:

ok 51 lines

Test #223:

score: 0
Accepted
time: 553ms
memory: 62508kb

input:

100000 551048 50
16697 16689
29423 29547
30099 30110
62497 62499
99112 99119
53694 53735
72678 72666
6446 6445
12338 12325
741 717
33657 33683
59569 59571
74160 74166
82320 82345
63997 63805
72364 72432
76756 77098
71325 71330
50459 50210
77312 77298
83284 83345
7724 8392
47255 47383
92017 92105
271...

output:

0
637804
528428
746880
814980
793750
804970
800521
848238
867472
929779
940846
948632
908554
999638
970723
986527
1033207
1045260
1155024
1196251
1161854
1088036
1344161
1202392
1361890
1730941
1395004
1317103
2208747
2097777
1619794
1646524
3501816
2870900
1832415
2228757
3095023
10651274
4188701
5...

result:

ok 51 lines

Test #224:

score: 0
Accepted
time: 627ms
memory: 63592kb

input:

100000 631974 50
76114 76180
68900 68926
80490 80540
23419 23508
79621 79333
75116 75032
24440 23203
58625 58661
32668 32651
62843 63042
94479 95576
17089 17174
62846 62860
56206 56166
92556 92096
45824 46444
72053 72050
74583 74620
4376 4394
23493 23531
46468 46465
63274 63152
87016 87026
22206 223...

output:

0
213365
312678
387415
457996
489183
516581
542712
572248
587015
601346
619076
630513
640747
648872
648262
665882
873495
851010
1008546
1206837
1177668
3518820
2392952
9767645
9366499
7760740
6127915
44552436
15413449
6493617
48341146
86735425
32557452
359279151
123805925
709970277
3515316329
0
0
0
...

result:

ok 51 lines

Test #225:

score: 0
Accepted
time: 519ms
memory: 61884kb

input:

100000 496036 50
20018 20080
96898 93407
38403 38486
61998 61965
15057 15236
2439 1177
29255 29247
72601 72656
39461 39457
23682 23898
51688 51712
99200 99218
83223 83220
76484 82857
22975 23073
82656 82935
66187 66069
79917 80083
36974 37091
18550 18514
40650 40752
95206 95200
5242 5227
95227 95202...

output:

0
213374
305342
368080
424275
470171
501497
537948
564750
580611
613235
636984
659903
740720
1049146
1087181
2835973
8078879
4365304
10340775
1911424516
5519395
2740302
3549815
318179771
12805436
9758020
20063121
4215180
23296672
59606789
4771725
10655625
27504735
353374298
4359588
8017208
218083488...

result:

ok 51 lines

Test #226:

score: 0
Accepted
time: 528ms
memory: 63088kb

input:

100000 596950 50
58228 58253
30406 30416
41130 41225
95850 95959
14167 14177
38186 38185
95693 95680
9138 9324
99930 99933
50396 53804
92327 92302
47433 47456
9048 9152
7664 7722
31792 32125
83116 83079
18433 18430
85307 85315
8373 8480
83037 83046
15737 15640
93145 93146
78450 78692
84293 85255
788...

output:

0
407105
436439
547902
632954
621522
632503
696524
720402
726898
733135
740325
761675
778166
766168
781558
897578
850422
1028073
923904
2168937
3664919
7147573
26247423
64071061
30963732
82937245
4750657080
2701349
3571651
239179
896429
3483516
1225211
735843
303048
353776
0
0
0
0
0
0
0
0
0
0
0
0
0
0

result:

ok 51 lines

Test #227:

score: 0
Accepted
time: 609ms
memory: 63504kb

input:

99999 599118 50
52699 52639
62169 63538
76737 76767
17394 17392
36934 36958
11009 11026
11204 21507
34175 34130
84946 84772
82324 82303
33421 33252
29306 29450
11054 11050
15724 15717
57387 57437
97593 97927
82112 81895
97095 96519
99889 99896
8625 8006
93936 93735
34152 34155
23597 25048
75350 7736...

output:

0
260924
318292
380407
431927
456740
486558
502775
531372
540845
551648
559115
575934
590000
617312
633866
786574
895092
1106532
1311608
1738288
2096357
2452047
2357416
2704438
2097596
2816399
2578227
3573710
9000863
48789159
14854589
13174002
19228332
13179839
8714958
47134058
35315886
23966411
725...

result:

ok 51 lines

Test #228:

score: 0
Accepted
time: 437ms
memory: 60548kb

input:

100000 409869 50
75398 74146
9552 9345
30665 30666
93637 93573
12339 12332
75267 75164
13392 15211
60978 60967
65028 65040
72581 70919
95276 95355
41837 41844
58360 58388
62866 62864
94692 94655
23819 23818
44690 44646
40554 40568
58237 58250
41443 41500
40929 40917
75479 74914
82903 82573
55273 629...

output:

0
531396
515142
657767
785396
766024
753127
770961
780330
834127
891699
877818
962954
986075
1091915
1008786
1247370
1849484
1464391
1407737
2341323
3135087
2719152
2114014
2049298
2499817
4763383
2697833
6041864
5362161
6599080
6297240
5608283
3691805
4286414
4417221
3524099
6758225
21725278
404324...

result:

ok 51 lines

Test #229:

score: 0
Accepted
time: 941ms
memory: 68384kb

input:

99995 966966 20
60598 60562
12027 12556
76047 76077
58450 58454
79152 78776
2858 2856
51835 51847
71693 71707
6743 6740
48415 48312
61100 61070
2410 2423
80028 80070
42549 42545
12876 12875
67663 67657
34591 34593
41492 41505
93841 93703
84711 85200
55394 55469
76490 76379
99692 99686
88088 88096
49...

output:

0
99975
99974
99973
99976
99980
100070
101124
131633
202437
857471
9664574
16596180
57176609
116081838
73438314
4722700172
0
0
0
0

result:

ok 21 lines

Test #230:

score: 0
Accepted
time: 967ms
memory: 66560kb

input:

100000 919708 29
10704 10703
8872 3978
79102 79813
39390 39318
972 979
46824 46839
73762 73219
82937 83892
69683 68306
54678 54671
91182 91117
67019 59272
81892 82003
91180 91129
79662 80807
70975 70880
80419 76691
2 17184
40905 40903
67559 67389
60986 60709
29308 29293
26040 26027
46987 46158
33269...

output:

0
100815
102591
109203
112573
121098
140595
151448
193551
229728
309528
522438
653306
1050502
1486838
2483018
3834929
5973973
9535727
17182058
22547368
44121215
42941977
101013593
115134586
248772326
797995269
1183039476
1820517193
576773484

result:

ok 30 lines

Test #231:

score: 0
Accepted
time: 1200ms
memory: 68100kb

input:

100000 1000000 50
53 54
53 56
53 58
53 64
53 76
53 112
53 166
53 253
53 443
53 844
53 1604
53 3193
53 6286
53 12557
53 25122
53 50095
54 57
54 60
54 66
54 77
54 113
54 167
54 255
54 445
54 845
54 1607
54 3194
54 6287
54 12559
54 25123
54 50096
56 57
56 62
56 67
56 79
56 114
56 168
56 256
56 446
56 8...

output:

4
99955
99954
99956
99969
100053
100317
101183
102747
106424
112213
121006
132638
153379
180753
227750
279435
386884
553900
706522
1029481
1493183
1926693
2447633
3049580
3731778
3934749
4443860
5320460
5822137
6760101
6131942
6976993
9080531
19239317
7898092
13337271
14598266
64844707
18392525
2175...

result:

ok 51 lines