QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#744130#3269. 末日魔法少女计划TheZone100 ✓80ms4708kbC++204.1kb2024-11-13 20:57:062024-11-13 20:57:12

Judging History

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

  • [2024-11-13 20:57:12]
  • 评测
  • 测评结果:100
  • 用时:80ms
  • 内存:4708kb
  • [2024-11-13 20:57:06]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int inf=1e9;
int f[16][2005],g[16][2005],fx[16][2005],gx[16][2005];
int eval(int k,int n,int o) {
	//o=1:pre, o=2:suf, o=3:pre&suf
	if(n<=1) return 0;
	if(o==1) return n-1+f[k][n-1];
	if(o==2) return n-1+f[k][n-1];
	if(o==3) return 2*n-3+f[k][n-2];
	return f[k][n];
}
struct info { int l,r; };
vector <info> e;
void link(info u,info v) { e.push_back({u.l,v.r}); }
void sol(vector<info>q,int k,int o) {
	#define sc(x,y) {q.begin()+x,q.begin()+y}
	int n=q.size();
	if(n<=1) return ;
	if(o==1) {
		for(int i=1;i<n;++i) link(q[0],q[i]);
		return sol(sc(1,n),k,0);
	}
	if(o==2) {
		for(int i=0;i<n-1;++i) link(q[i],q[n-1]);
		return sol(sc(0,n-1),k,0);
	}
	if(o==3) {
		for(int i=1;i<n-1;++i) link(q[0],q[i]),link(q[i],q[n-1]);
		return link(q[0],q[n-1]),sol(sc(1,n-1),k,0);
	}
	if(n<=k) return ;
	else if(k==1) for(int i=0;i<n;++i) for(int j=i+1;j<n;++j) link(q[i],q[j]);
	else if(k==2) sol(sc(0,n/2),k,2),sol(sc(n/2,n),k,1);
	else {
		int wd=fx[k][n];
		sol(sc(0,wd),k,2),sol(sc(n-wd,n),k,1);
		vector<info> s;
		int b=gx[k][n-2*wd],d=(n-2*wd)/b,r=(n-2*wd)%b,it=wd;
		for(int i=0;i<b-r;++i) sol(sc(it,it+d),k,3),s.push_back({q[it].l,q[it+d-1].r}),it+=d;
		for(int i=0;i<r;++i) sol(sc(it,it+d+1),k,3),s.push_back({q[it].l,q[it+d].r}),it+=d+1;
		sol(s,k-2,0);
	}
}
signed main() {
	for(int k=1;k<=15;++k) for(int n=2;n<=2000;++n) {
		g[k][n]=inf;
		for(int b=1;b<=n;++b) {
			int d=n/b,r=n%b,tmp=eval(k-2,b,0)+eval(k,d,3)*(b-r)+eval(k,d+1,3)*r;
			if(tmp<g[k][n]) g[k][n]=tmp,gx[k][n]=b;
		}
		if(n<=k) f[k][n]=0;
		else if(k==1) f[k][n]=n*(n-1)/2;
		else if(k==2) f[k][n]=eval(k,n/2,2)+eval(k,n-n/2,1);
		else {
			f[k][n]=inf;
			for(int i=1;i<=n/2;++i) {
				int tmp=g[k][n-2*i]+eval(k,i,2)+eval(k,i,1);
				if(tmp<f[k][n]) f[k][n]=tmp,fx[k][n]=i;
			}
		}
	}
	int N,K;
	scanf("%d%d",&N,&K);
	vector <info> I;
	for(int i=0;i<N;++i) I.push_back({i,i+1});
	sol(I,K,0);
	printf("%d\n",(int)e.size());
	for(auto x:e) printf("%d %d\n",x.l,x.r);
	return 0;
}
/*#include<bits/stdc++.h>
using namespace std;
const int inf=1e9;
int f[16][2005],g[16][2005],fx[16][2005],gx[16][2005];
int eval(int k,int n,int o) {
	//o=1:pre, o=2:suf, o=3:pre&suf
	if(n<=1) return 0;
	if(o==1) return n-1+f[k][n-1];
	if(o==2) return n-1+f[k][n-1];
	if(o==3) return 2*n-3+f[k][n-2];
	return f[k][n];
}
struct info { int l,r; };
vector <info> e;
void link(info u,info v) { e.push_back({u.l,v.r}); }
void sol(vector<info>q,int k,int o) {
	#define sc(x,y) {q.begin()+x,q.begin()+y}
	int n=q.size();
	if(n<=1) return ;
	if(o==1) {
		for(int i=1;i<n;++i) link(q[0],q[i]);
		return sol(sc(1,n),k,0);
	}
	if(o==2) {
		for(int i=0;i<n-1;++i) link(q[i],q[n-1]);
		return sol(sc(0,n-1),k,0);
	}
	if(o==3) {
		for(int i=1;i<n-1;++i) link(q[0],q[i]),link(q[i],q[n-1]);
		return link(q[0],q[n-1]),sol(sc(1,n-1),k,0);
	}
	if(n<=k) return ;
	else if(k==1) for(int i=0;i<n;++i) for(int j=i+1;j<n;++j) link(q[i],q[j]);
	else if(k==2) sol(sc(0,n/2),k,2),sol(sc(n/2,n),k,1);
	else {
		int wd=fx[k][n];
		sol(sc(0,wd),k,2),sol(sc(n-wd,n),k,1);
		vector<info> s;
		int b=gx[k][n-2*wd],d=(n-2*wd)/b,r=(n-2*wd)%b,it=wd;
		for(int i=0;i<b-r;++i) sol(sc(it,it+d),k,3),s.push_back({q[it].l,q[it+d-1].r}),it+=d;
		for(int i=0;i<r;++i) sol(sc(it,it+d+1),k,3),s.push_back({q[it].l,q[it+d].r}),it+=d+1;
		sol(s,k-2,0);
	}
}
signed main() {
	for(int k=1;k<=15;++k) for(int n=2;n<=2000;++n) {
		g[k][n]=inf;
		for(int b=1;b<=n;++b) {
			int d=n/b,r=n%b,tmp=eval(k-2,b,0)+eval(k,d,3)*(b-r)+eval(k,d+1,3)*r;
			if(tmp<g[k][n]) g[k][n]=tmp,gx[k][n]=b;
		}
		if(n<=k) f[k][n]=0;
		else if(k==1) f[k][n]=n*(n-1)/2;
		else if(k==2) f[k][n]=eval(k,n/2,2)+eval(k,n-n/2,1);
		else {
			f[k][n]=inf;
			for(int i=1;i<=n/2;++i) {
				int tmp=g[k][n-2*i]+eval(k,i,2)+eval(k,i,1);
				if(tmp<f[k][n]) f[k][n]=tmp,fx[k][n]=i;
			}
		}
	}
	int N,K;
	scanf("%d%d",&N,&K);
	vector <info> I;
	for(int i=0;i<N;++i) I.push_back({i,i+1});
	sol(I,K,0);
	printf("%d\n",(int)e.size());
	for(auto x:e) printf("%d %d\n",x.l,x.r);
	return 0;
}*/

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 22
Accepted

Test #1:

score: 22
Accepted
time: 80ms
memory: 4444kb

input:

2000 2

output:

15974
0 1000
1 1000
2 1000
3 1000
4 1000
5 1000
6 1000
7 1000
8 1000
9 1000
10 1000
11 1000
12 1000
13 1000
14 1000
15 1000
16 1000
17 1000
18 1000
19 1000
20 1000
21 1000
22 1000
23 1000
24 1000
25 1000
26 1000
27 1000
28 1000
29 1000
30 1000
31 1000
32 1000
33 1000
34 1000
35 1000
36 1000
37 1000
...

result:

ok 

Test #2:

score: 22
Accepted
time: 76ms
memory: 4492kb

input:

1999 2

output:

15965
0 999
1 999
2 999
3 999
4 999
5 999
6 999
7 999
8 999
9 999
10 999
11 999
12 999
13 999
14 999
15 999
16 999
17 999
18 999
19 999
20 999
21 999
22 999
23 999
24 999
25 999
26 999
27 999
28 999
29 999
30 999
31 999
32 999
33 999
34 999
35 999
36 999
37 999
38 999
39 999
40 999
41 999
42 999
43 ...

result:

ok 

Test #3:

score: 22
Accepted
time: 80ms
memory: 4424kb

input:

1992 2

output:

15902
0 996
1 996
2 996
3 996
4 996
5 996
6 996
7 996
8 996
9 996
10 996
11 996
12 996
13 996
14 996
15 996
16 996
17 996
18 996
19 996
20 996
21 996
22 996
23 996
24 996
25 996
26 996
27 996
28 996
29 996
30 996
31 996
32 996
33 996
34 996
35 996
36 996
37 996
38 996
39 996
40 996
41 996
42 996
43 ...

result:

ok 

Test #4:

score: 22
Accepted
time: 74ms
memory: 4500kb

input:

1973 2

output:

15731
0 986
1 986
2 986
3 986
4 986
5 986
6 986
7 986
8 986
9 986
10 986
11 986
12 986
13 986
14 986
15 986
16 986
17 986
18 986
19 986
20 986
21 986
22 986
23 986
24 986
25 986
26 986
27 986
28 986
29 986
30 986
31 986
32 986
33 986
34 986
35 986
36 986
37 986
38 986
39 986
40 986
41 986
42 986
43 ...

result:

ok 

Test #5:

score: 22
Accepted
time: 76ms
memory: 4708kb

input:

1936 2

output:

15398
0 968
1 968
2 968
3 968
4 968
5 968
6 968
7 968
8 968
9 968
10 968
11 968
12 968
13 968
14 968
15 968
16 968
17 968
18 968
19 968
20 968
21 968
22 968
23 968
24 968
25 968
26 968
27 968
28 968
29 968
30 968
31 968
32 968
33 968
34 968
35 968
36 968
37 968
38 968
39 968
40 968
41 968
42 968
43 ...

result:

ok 

Subtask #2:

score: 14
Accepted

Test #6:

score: 14
Accepted
time: 79ms
memory: 4672kb

input:

1936 3

output:

7339
0 248
1 248
2 248
3 248
4 248
5 248
6 248
7 248
8 248
9 248
10 248
11 248
12 248
13 248
14 248
15 248
16 248
17 248
18 248
19 248
20 248
21 248
22 248
23 248
24 248
25 248
26 248
27 248
28 248
29 248
30 248
31 248
32 248
33 248
34 248
35 248
36 248
37 248
38 248
39 248
40 248
41 248
42 248
43 2...

result:

ok 

Test #7:

score: 14
Accepted
time: 79ms
memory: 4388kb

input:

2000 3

output:

7606
0 232
1 232
2 232
3 232
4 232
5 232
6 232
7 232
8 232
9 232
10 232
11 232
12 232
13 232
14 232
15 232
16 232
17 232
18 232
19 232
20 232
21 232
22 232
23 232
24 232
25 232
26 232
27 232
28 232
29 232
30 232
31 232
32 232
33 232
34 232
35 232
36 232
37 232
38 232
39 232
40 232
41 232
42 232
43 2...

result:

ok 

Test #8:

score: 14
Accepted
time: 79ms
memory: 4412kb

input:

1999 3

output:

7602
0 232
1 232
2 232
3 232
4 232
5 232
6 232
7 232
8 232
9 232
10 232
11 232
12 232
13 232
14 232
15 232
16 232
17 232
18 232
19 232
20 232
21 232
22 232
23 232
24 232
25 232
26 232
27 232
28 232
29 232
30 232
31 232
32 232
33 232
34 232
35 232
36 232
37 232
38 232
39 232
40 232
41 232
42 232
43 2...

result:

ok 

Test #9:

score: 14
Accepted
time: 79ms
memory: 4372kb

input:

1992 3

output:

7574
0 228
1 228
2 228
3 228
4 228
5 228
6 228
7 228
8 228
9 228
10 228
11 228
12 228
13 228
14 228
15 228
16 228
17 228
18 228
19 228
20 228
21 228
22 228
23 228
24 228
25 228
26 228
27 228
28 228
29 228
30 228
31 228
32 228
33 228
34 228
35 228
36 228
37 228
38 228
39 228
40 228
41 228
42 228
43 2...

result:

ok 

Test #10:

score: 14
Accepted
time: 79ms
memory: 4672kb

input:

1973 3

output:

7494
0 243
1 243
2 243
3 243
4 243
5 243
6 243
7 243
8 243
9 243
10 243
11 243
12 243
13 243
14 243
15 243
16 243
17 243
18 243
19 243
20 243
21 243
22 243
23 243
24 243
25 243
26 243
27 243
28 243
29 243
30 243
31 243
32 243
33 243
34 243
35 243
36 243
37 243
38 243
39 243
40 243
41 243
42 243
43 2...

result:

ok 

Subtask #3:

score: 11
Accepted

Test #11:

score: 11
Accepted
time: 79ms
memory: 4480kb

input:

2000 4

output:

4792
0 37
1 37
2 37
3 37
4 37
5 37
6 37
7 37
8 37
9 37
10 37
11 37
12 37
13 37
14 37
15 37
16 37
17 37
18 37
19 37
20 37
21 37
22 37
23 37
24 37
25 37
26 37
27 37
28 37
29 37
30 37
31 37
32 37
33 37
34 37
35 37
0 5
1 5
2 5
3 5
31 33
31 34
31 35
31 36
5 7
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
...

result:

ok 

Test #12:

score: 11
Accepted
time: 80ms
memory: 4684kb

input:

1999 4

output:

4789
0 39
1 39
2 39
3 39
4 39
5 39
6 39
7 39
8 39
9 39
10 39
11 39
12 39
13 39
14 39
15 39
16 39
17 39
18 39
19 39
20 39
21 39
22 39
23 39
24 39
25 39
26 39
27 39
28 39
29 39
30 39
31 39
32 39
33 39
34 39
35 39
36 39
37 39
0 5
1 5
2 5
3 5
33 35
33 36
33 37
33 38
5 7
7 9
9 11
11 13
13 15
15 17
17 19
...

result:

ok 

Test #13:

score: 11
Accepted
time: 75ms
memory: 4416kb

input:

1991 4

output:

4768
0 39
1 39
2 39
3 39
4 39
5 39
6 39
7 39
8 39
9 39
10 39
11 39
12 39
13 39
14 39
15 39
16 39
17 39
18 39
19 39
20 39
21 39
22 39
23 39
24 39
25 39
26 39
27 39
28 39
29 39
30 39
31 39
32 39
33 39
34 39
35 39
36 39
37 39
0 5
1 5
2 5
3 5
33 35
33 36
33 37
33 38
5 7
7 9
9 11
11 13
13 15
15 17
17 19
...

result:

ok 

Test #14:

score: 11
Accepted
time: 72ms
memory: 4384kb

input:

1971 4

output:

4715
0 37
1 37
2 37
3 37
4 37
5 37
6 37
7 37
8 37
9 37
10 37
11 37
12 37
13 37
14 37
15 37
16 37
17 37
18 37
19 37
20 37
21 37
22 37
23 37
24 37
25 37
26 37
27 37
28 37
29 37
30 37
31 37
32 37
33 37
34 37
35 37
0 5
1 5
2 5
3 5
31 33
31 34
31 35
31 36
5 7
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
...

result:

ok 

Test #15:

score: 11
Accepted
time: 79ms
memory: 4412kb

input:

1938 4

output:

4626
0 39
1 39
2 39
3 39
4 39
5 39
6 39
7 39
8 39
9 39
10 39
11 39
12 39
13 39
14 39
15 39
16 39
17 39
18 39
19 39
20 39
21 39
22 39
23 39
24 39
25 39
26 39
27 39
28 39
29 39
30 39
31 39
32 39
33 39
34 39
35 39
36 39
37 39
0 5
1 5
2 5
3 5
33 35
33 36
33 37
33 38
5 7
7 9
9 11
11 13
13 15
15 17
17 19
...

result:

ok 

Subtask #4:

score: 9
Accepted

Test #16:

score: 9
Accepted
time: 79ms
memory: 4372kb

input:

2000 5

output:

3922
0 34
1 34
2 34
3 34
4 34
5 34
6 34
7 34
8 34
9 34
10 34
11 34
12 34
13 34
14 34
15 34
16 34
17 34
18 34
19 34
20 34
21 34
22 34
23 34
24 34
25 34
26 34
27 34
28 34
29 34
30 34
31 34
32 34
0 5
1 5
2 5
3 5
28 30
28 31
28 32
28 33
6 8
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
5 12...

result:

ok 

Test #17:

score: 9
Accepted
time: 79ms
memory: 4284kb

input:

1999 5

output:

3920
0 34
1 34
2 34
3 34
4 34
5 34
6 34
7 34
8 34
9 34
10 34
11 34
12 34
13 34
14 34
15 34
16 34
17 34
18 34
19 34
20 34
21 34
22 34
23 34
24 34
25 34
26 34
27 34
28 34
29 34
30 34
31 34
32 34
0 5
1 5
2 5
3 5
28 30
28 31
28 32
28 33
6 8
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
5 12...

result:

ok 

Test #18:

score: 9
Accepted
time: 75ms
memory: 4368kb

input:

1992 5

output:

3906
0 30
1 30
2 30
3 30
4 30
5 30
6 30
7 30
8 30
9 30
10 30
11 30
12 30
13 30
14 30
15 30
16 30
17 30
18 30
19 30
20 30
21 30
22 30
23 30
24 30
25 30
26 30
27 30
28 30
0 3
1 3
26 28
26 29
4 6
6 8
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
3 10
4 10
6 10
18 22
18 24
18 26
10 14
14 18
10 18...

result:

ok 

Test #19:

score: 9
Accepted
time: 79ms
memory: 4356kb

input:

1973 5

output:

3866
0 35
1 35
2 35
3 35
4 35
5 35
6 35
7 35
8 35
9 35
10 35
11 35
12 35
13 35
14 35
15 35
16 35
17 35
18 35
19 35
20 35
21 35
22 35
23 35
24 35
25 35
26 35
27 35
28 35
29 35
30 35
31 35
32 35
33 35
0 5
1 5
2 5
3 5
29 31
29 32
29 33
29 34
5 7
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
...

result:

ok 

Test #20:

score: 9
Accepted
time: 80ms
memory: 4380kb

input:

1936 5

output:

3792
0 16
1 16
2 16
3 16
4 16
5 16
6 16
7 16
8 16
9 16
10 16
11 16
12 16
13 16
14 16
2 4
4 6
6 8
8 10
10 12
12 14
1 4
10 14
6 10
4 10
1920 1922
1920 1923
1920 1924
1920 1925
1920 1926
1920 1927
1920 1928
1920 1929
1920 1930
1920 1931
1920 1932
1920 1933
1920 1934
1920 1935
1920 1936
1923 1925
1925 1...

result:

ok 

Subtask #5:

score: 7
Accepted

Test #21:

score: 7
Accepted
time: 79ms
memory: 4364kb

input:

2000 6

output:

3213
0 7
1 7
2 7
3 7
4 7
5 7
1993 1995
1993 1996
1993 1997
1993 1998
1993 1999
1993 2000
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
75 77
77 7...

result:

ok 

Test #22:

score: 7
Accepted
time: 79ms
memory: 4352kb

input:

1997 6

output:

3208
0 7
1 7
2 7
3 7
4 7
5 7
1990 1992
1990 1993
1990 1994
1990 1995
1990 1996
1990 1997
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
75 77
77 7...

result:

ok 

Test #23:

score: 7
Accepted
time: 79ms
memory: 4384kb

input:

1989 6

output:

3194
0 7
1 7
2 7
3 7
4 7
5 7
1982 1984
1982 1985
1982 1986
1982 1987
1982 1988
1982 1989
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
75 77
77 7...

result:

ok 

Test #24:

score: 7
Accepted
time: 79ms
memory: 4612kb

input:

1972 6

output:

3164
0 7
1 7
2 7
3 7
4 7
5 7
1965 1967
1965 1968
1965 1969
1965 1970
1965 1971
1965 1972
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
75 77
77 7...

result:

ok 

Test #25:

score: 7
Accepted
time: 78ms
memory: 4356kb

input:

1933 6

output:

3096
0 7
1 7
2 7
3 7
4 7
5 7
1926 1928
1926 1929
1926 1930
1926 1931
1926 1932
1926 1933
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
75 77
77 7...

result:

ok 

Subtask #6:

score: 6
Accepted

Test #26:

score: 6
Accepted
time: 79ms
memory: 4452kb

input:

1999 7

output:

2901
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1991 1993
1991 1994
1991 1995
1991 1996
1991 1997
1991 1998
1991 1999
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
...

result:

ok 

Test #27:

score: 6
Accepted
time: 79ms
memory: 4348kb

input:

1997 7

output:

2898
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1989 1991
1989 1992
1989 1993
1989 1994
1989 1995
1989 1996
1989 1997
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
...

result:

ok 

Test #28:

score: 6
Accepted
time: 79ms
memory: 4644kb

input:

1987 7

output:

2883
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1979 1981
1979 1982
1979 1983
1979 1984
1979 1985
1979 1986
1979 1987
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
...

result:

ok 

Test #29:

score: 6
Accepted
time: 75ms
memory: 4660kb

input:

1978 7

output:

2869
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1970 1972
1970 1973
1970 1974
1970 1975
1970 1976
1970 1977
1970 1978
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
...

result:

ok 

Test #30:

score: 6
Accepted
time: 79ms
memory: 4352kb

input:

1931 7

output:

2799
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1923 1925
1923 1926
1923 1927
1923 1928
1923 1929
1923 1930
1923 1931
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
...

result:

ok 

Subtask #7:

score: 5
Accepted

Test #31:

score: 5
Accepted
time: 79ms
memory: 4380kb

input:

1995 8

output:

2501
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1987 1989
1987 1990
1987 1991
1987 1992
1987 1993
1987 1994
1987 1995
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
...

result:

ok 

Test #32:

score: 5
Accepted
time: 79ms
memory: 4372kb

input:

1999 8

output:

2506
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1991 1993
1991 1994
1991 1995
1991 1996
1991 1997
1991 1998
1991 1999
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
...

result:

ok 

Test #33:

score: 5
Accepted
time: 79ms
memory: 4344kb

input:

1987 8

output:

2490
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1978 1980
1978 1981
1978 1982
1978 1983
1978 1984
1978 1985
1978 1986
1978 1987
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 7...

result:

ok 

Test #34:

score: 5
Accepted
time: 79ms
memory: 4348kb

input:

1981 8

output:

2481
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1972 1974
1972 1975
1972 1976
1972 1977
1972 1978
1972 1979
1972 1980
1972 1981
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 ...

result:

ok 

Test #35:

score: 5
Accepted
time: 79ms
memory: 4376kb

input:

1923 8

output:

2405
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1915 1917
1915 1918
1915 1919
1915 1920
1915 1921
1915 1922
1915 1923
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
...

result:

ok 

Subtask #8:

score: 5
Accepted

Test #36:

score: 5
Accepted
time: 79ms
memory: 4336kb

input:

1997 9

output:

2392
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1988 1990
1988 1991
1988 1992
1988 1993
1988 1994
1988 1995
1988 1996
1988 1997
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 ...

result:

ok 

Test #37:

score: 5
Accepted
time: 79ms
memory: 4600kb

input:

1998 9

output:

2393
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1989 1991
1989 1992
1989 1993
1989 1994
1989 1995
1989 1996
1989 1997
1989 1998
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 7...

result:

ok 

Test #38:

score: 5
Accepted
time: 80ms
memory: 4376kb

input:

1990 9

output:

2383
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1981 1983
1981 1984
1981 1985
1981 1986
1981 1987
1981 1988
1981 1989
1981 1990
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 7...

result:

ok 

Test #39:

score: 5
Accepted
time: 79ms
memory: 4344kb

input:

1975 9

output:

2364
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1965 1967
1965 1968
1965 1969
1965 1970
1965 1971
1965 1972
1965 1973
1965 1974
1965 1975
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 6...

result:

ok 

Test #40:

score: 5
Accepted
time: 79ms
memory: 4644kb

input:

1934 9

output:

2313
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1925 1927
1925 1928
1925 1929
1925 1930
1925 1931
1925 1932
1925 1933
1925 1934
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 7...

result:

ok 

Subtask #9:

score: 4
Accepted

Test #41:

score: 4
Accepted
time: 79ms
memory: 4376kb

input:

1995 10

output:

2193
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1987 1989
1987 1990
1987 1991
1987 1992
1987 1993
1987 1994
1987 1995
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
...

result:

ok 

Test #42:

score: 4
Accepted
time: 75ms
memory: 4428kb

input:

1996 10

output:

2194
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1988 1990
1988 1991
1988 1992
1988 1993
1988 1994
1988 1995
1988 1996
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
...

result:

ok 

Test #43:

score: 4
Accepted
time: 79ms
memory: 4356kb

input:

1979 10

output:

2175
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1971 1973
1971 1974
1971 1975
1971 1976
1971 1977
1971 1978
1971 1979
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
...

result:

ok 

Test #44:

score: 4
Accepted
time: 79ms
memory: 4296kb

input:

1972 10

output:

2166
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1962 1964
1962 1965
1962 1966
1962 1967
1962 1968
1962 1969
1962 1970
1962 1971
1962 1972
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 6...

result:

ok 

Test #45:

score: 4
Accepted
time: 79ms
memory: 4628kb

input:

1945 10

output:

2135
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1934 1936
1934 1937
1934 1938
1934 1939
1934 1940
1934 1941
1934 1942
1934 1943
1934 1944
1934 1945
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
6...

result:

ok 

Subtask #10:

score: 4
Accepted

Test #46:

score: 4
Accepted
time: 80ms
memory: 4644kb

input:

1993 11

output:

2133
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1984 1986
1984 1987
1984 1988
1984 1989
1984 1990
1984 1991
1984 1992
1984 1993
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 ...

result:

ok 

Test #47:

score: 4
Accepted
time: 75ms
memory: 4364kb

input:

1994 11

output:

2134
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1985 1987
1985 1988
1985 1989
1985 1990
1985 1991
1985 1992
1985 1993
1985 1994
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 7...

result:

ok 

Test #48:

score: 4
Accepted
time: 80ms
memory: 4436kb

input:

2000 11

output:

2140
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1988 1990
1988 1991
1988 1992
1988 1993
1988 1994
1988 1995
1988 1996
1988 1997
1988 1998
1988 1999
1988 2000
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 ...

result:

ok 

Test #49:

score: 4
Accepted
time: 79ms
memory: 4372kb

input:

1972 11

output:

2109
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1962 1964
1962 1965
1962 1966
1962 1967
1962 1968
1962 1969
1962 1970
1962 1971
1962 1972
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 6...

result:

ok 

Test #50:

score: 4
Accepted
time: 75ms
memory: 4436kb

input:

1944 11

output:

2077
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1932 1934
1932 1935
1932 1936
1932 1937
1932 1938
1932 1939
1932 1940
1932 1941
1932 1942
1932 1943
1932 1944
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 ...

result:

ok 

Subtask #11:

score: 4
Accepted

Test #51:

score: 4
Accepted
time: 79ms
memory: 4444kb

input:

1999 12

output:

2067
0 6
1 6
2 6
3 6
4 6
1993 1995
1993 1996
1993 1997
1993 1998
1993 1999
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
75 77
77 79
79 81
81 83
...

result:

ok 

Test #52:

score: 4
Accepted
time: 79ms
memory: 4368kb

input:

2000 12

output:

2068
0 6
1 6
2 6
3 6
4 6
1994 1996
1994 1997
1994 1998
1994 1999
1994 2000
6 8
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
74 76
76 78
78 80
80 82
...

result:

ok 

Test #53:

score: 4
Accepted
time: 75ms
memory: 4352kb

input:

1989 12

output:

2056
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1980 1982
1980 1983
1980 1984
1980 1985
1980 1986
1980 1987
1980 1988
1980 1989
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 ...

result:

ok 

Test #54:

score: 4
Accepted
time: 78ms
memory: 4328kb

input:

1976 12

output:

2042
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1966 1968
1966 1969
1966 1970
1966 1971
1966 1972
1966 1973
1966 1974
1966 1975
1966 1976
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 6...

result:

ok 

Test #55:

score: 4
Accepted
time: 79ms
memory: 4624kb

input:

1949 12

output:

2013
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1936 1938
1936 1939
1936 1940
1936 1941
1936 1942
1936 1943
1936 1944
1936 1945
1936 1946
1936 1947
1936 1948
1936 1949
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52...

result:

ok 

Subtask #12:

score: 3
Accepted

Test #56:

score: 3
Accepted
time: 79ms
memory: 4628kb

input:

1981 13

output:

2004
2 4
4 6
6 8
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
74 76
76 78
78 80
80 82
82 84
84 86
86 88
88 90
90 92
92 94
94 96
96 98
98 100
100 102...

result:

ok 

Test #57:

score: 3
Accepted
time: 79ms
memory: 4616kb

input:

1982 13

output:

2005
1 3
3 5
5 7
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
75 77
77 79
79 81
81 83
83 85
85 87
87 89
89 91
91 93
93 95
95 97
97 99
99 101
101...

result:

ok 

Test #58:

score: 3
Accepted
time: 79ms
memory: 4324kb

input:

1989 13

output:

2012
0 3
1 3
1986 1988
1986 1989
4 6
6 8
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
74 76
76 78
78 80
80 82
82 84
84 86
86 88
88 90
90 92
92 94
94...

result:

ok 

Test #59:

score: 3
Accepted
time: 79ms
memory: 4352kb

input:

1972 13

output:

1994
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1962 1964
1962 1965
1962 1966
1962 1967
1962 1968
1962 1969
1962 1970
1962 1971
1962 1972
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 6...

result:

ok 

Test #60:

score: 3
Accepted
time: 80ms
memory: 4408kb

input:

1929 13

output:

1949
0 5
1 5
2 5
3 5
1924 1926
1924 1927
1924 1928
1924 1929
6 8
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
74 76
76 78
78 80
80 82
82 84
84 86
86...

result:

ok 

Subtask #13:

score: 3
Accepted

Test #61:

score: 3
Accepted
time: 79ms
memory: 4352kb

input:

1979 14

output:

1981
2 4
4 6
6 8
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
74 76
76 78
78 80
80 82
82 84
84 86
86 88
88 90
90 92
92 94
94 96
96 98
98 100
100 102...

result:

ok 

Test #62:

score: 3
Accepted
time: 79ms
memory: 4332kb

input:

1980 14

output:

1982
1 3
3 5
5 7
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
75 77
77 79
79 81
81 83
83 85
85 87
87 89
89 91
91 93
93 95
95 97
97 99
99 101
101...

result:

ok 

Test #63:

score: 3
Accepted
time: 79ms
memory: 4408kb

input:

1987 14

output:

1989
0 4
1 4
2 4
1983 1985
1983 1986
1983 1987
5 7
7 9
9 11
11 13
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 57
57 59
59 61
61 63
63 65
65 67
67 69
69 71
71 73
73 75
75 77
77 79
79 81
81 83
83 85
85 87
87 89
89 91
...

result:

ok 

Test #64:

score: 3
Accepted
time: 79ms
memory: 4624kb

input:

1952 14

output:

1953
0 2
1950 1952
2 4
4 6
6 8
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
74 76
76 78
78 80
80 82
82 84
84 86
86 88
88 90
90 92
92 94
94 96
96 98
...

result:

ok 

Test #65:

score: 3
Accepted
time: 79ms
memory: 4344kb

input:

1936 14

output:

1936
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1926 1928
1926 1929
1926 1930
1926 1931
1926 1932
1926 1933
1926 1934
1926 1935
1926 1936
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 6...

result:

ok 

Subtask #14:

score: 3
Accepted

Test #66:

score: 3
Accepted
time: 79ms
memory: 4352kb

input:

2000 15

output:

1988
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1988 1990
1988 1991
1988 1992
1988 1993
1988 1994
1988 1995
1988 1996
1988 1997
1988 1998
1988 1999
1988 2000
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 ...

result:

ok 

Test #67:

score: 3
Accepted
time: 79ms
memory: 4352kb

input:

1999 15

output:

1987
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1987 1989
1987 1990
1987 1991
1987 1992
1987 1993
1987 1994
1987 1995
1987 1996
1987 1997
1987 1998
1987 1999
13 15
15 17
17 19
19 21
21 23
23 25
25 27
27 29
29 31
31 33
33 35
35 37
37 39
39 41
41 43
43 45
45 47
47 49
49 51
51 53
53 55
55 ...

result:

ok 

Test #68:

score: 3
Accepted
time: 78ms
memory: 4420kb

input:

1992 15

output:

1980
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1984 1986
1984 1987
1984 1988
1984 1989
1984 1990
1984 1991
1984 1992
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
...

result:

ok 

Test #69:

score: 3
Accepted
time: 79ms
memory: 4352kb

input:

1973 15

output:

1961
2 4
4 6
6 8
8 10
10 12
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 56
56 58
58 60
60 62
62 64
64 66
66 68
68 70
70 72
72 74
74 76
76 78
78 80
80 82
82 84
84 86
86 88
88 90
90 92
92 94
94 96
96 98
98 100
100 102...

result:

ok 

Test #70:

score: 3
Accepted
time: 78ms
memory: 4612kb

input:

1936 15

output:

1923
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1924 1926
1924 1927
1924 1928
1924 1929
1924 1930
1924 1931
1924 1932
1924 1933
1924 1934
1924 1935
1924 1936
12 14
14 16
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38
38 40
40 42
42 44
44 46
46 48
48 50
50 52
52 54
54 ...

result:

ok