QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#288605#3269. 末日魔法少女计划qwq100 ✓833ms4288kbC++143.9kb2023-12-23 03:50:092023-12-23 03:50:10

详细

Subtask #1:

score: 22
Accepted

Test #1:

score: 22
Accepted
time: 794ms
memory: 4108kb

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: 791ms
memory: 4204kb

input:

1999 2

output:

15965
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 #3:

score: 22
Accepted
time: 798ms
memory: 4232kb

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: 800ms
memory: 4112kb

input:

1973 2

output:

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

result:

ok 

Test #5:

score: 22
Accepted
time: 798ms
memory: 4288kb

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: 825ms
memory: 4216kb

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: 797ms
memory: 4268kb

input:

2000 3

output:

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

result:

ok 

Test #8:

score: 14
Accepted
time: 801ms
memory: 4096kb

input:

1999 3

output:

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

result:

ok 

Test #9:

score: 14
Accepted
time: 816ms
memory: 4100kb

input:

1992 3

output:

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

result:

ok 

Test #10:

score: 14
Accepted
time: 802ms
memory: 4084kb

input:

1973 3

output:

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

result:

ok 

Subtask #3:

score: 11
Accepted

Test #11:

score: 11
Accepted
time: 796ms
memory: 4172kb

input:

2000 4

output:

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

result:

ok 

Test #12:

score: 11
Accepted
time: 801ms
memory: 4220kb

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: 796ms
memory: 4196kb

input:

1991 4

output:

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

result:

ok 

Test #14:

score: 11
Accepted
time: 800ms
memory: 4220kb

input:

1971 4

output:

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

result:

ok 

Test #15:

score: 11
Accepted
time: 797ms
memory: 4092kb

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: 794ms
memory: 4096kb

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
27 29
27 30
27 31
27 32
27 33
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 #17:

score: 9
Accepted
time: 801ms
memory: 4200kb

input:

1999 5

output:

3920
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 6
1 6
2 6
3 6
4 6
30 32
30 33
30 34
30 35
30 36
6 8
8 10
10 12
12 14
14 16
16 18
18 20
...

result:

ok 

Test #18:

score: 9
Accepted
time: 798ms
memory: 4104kb

input:

1992 5

output:

3906
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 6
1 6
2 6
3 6
4 6
30 32
30 33
30 34
30 35
30 36
6 8
8 10
10 12
12 14
14 16
16 18
18 20
...

result:

ok 

Test #19:

score: 9
Accepted
time: 815ms
memory: 4088kb

input:

1973 5

output:

3866
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
27 29
27 30
27 31
27 32
27 33
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: 799ms
memory: 4092kb

input:

1936 5

output:

3792
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 6
1 6
2 6
3 6
4 6
30 32
30 33
30 34
30 35
30 36
6 8
8 10
10 12
12 14
14 16
16 18
18 20
...

result:

ok 

Subtask #5:

score: 7
Accepted

Test #21:

score: 7
Accepted
time: 814ms
memory: 4068kb

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: 794ms
memory: 4280kb

input:

1997 6

output:

3208
0 6
1 6
2 6
3 6
4 6
1990 1992
1990 1993
1990 1994
1990 1995
1990 1996
1990 1997
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...

result:

ok 

Test #23:

score: 7
Accepted
time: 797ms
memory: 4108kb

input:

1989 6

output:

3194
0 6
1 6
2 6
3 6
4 6
1982 1984
1982 1985
1982 1986
1982 1987
1982 1988
1982 1989
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...

result:

ok 

Test #24:

score: 7
Accepted
time: 814ms
memory: 4112kb

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: 795ms
memory: 4100kb

input:

1933 6

output:

3096
0 6
1 6
2 6
3 6
4 6
1926 1928
1926 1929
1926 1930
1926 1931
1926 1932
1926 1933
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...

result:

ok 

Subtask #6:

score: 6
Accepted

Test #26:

score: 6
Accepted
time: 801ms
memory: 4212kb

input:

1999 7

output:

2737
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
8 11
9 11
11 14
12 14
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41
41 44
42 44
44 47
45 47
47 50
48 50
50 53
51 53
53 56
54 56
56 59
57 59
59 62...

result:

ok 

Test #27:

score: 6
Accepted
time: 794ms
memory: 4272kb

input:

1997 7

output:

2735
0 7
1 7
2 7
3 7
4 7
5 7
1990 1992
1990 1993
1990 1994
1990 1995
1990 1996
7 10
8 10
10 13
11 13
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43
41 43
43 46
44 46
46 49
47 49
49 52
50 52
52 55
53 55
55 58
56 58
58 61
59 61
61 64
6...

result:

ok 

Test #28:

score: 6
Accepted
time: 793ms
memory: 4216kb

input:

1987 7

output:

2719
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
8 11
9 11
11 14
12 14
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41
41 44
42 44
44 47
45 47
47 50
48 50
50 53
51 53
53 56
54 56
56 59
57 59
59 62...

result:

ok 

Test #29:

score: 6
Accepted
time: 797ms
memory: 4104kb

input:

1978 7

output:

2707
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
8 11
9 11
11 14
12 14
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41
41 44
42 44
44 47
45 47
47 50
48 50
50 53
51 53
53 56
54 56
56 59
57 59
59 62...

result:

ok 

Test #30:

score: 6
Accepted
time: 803ms
memory: 4272kb

input:

1931 7

output:

2639
0 7
1 7
2 7
3 7
4 7
5 7
1924 1926
1924 1927
1924 1928
1924 1929
1924 1930
7 10
8 10
10 13
11 13
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43
41 43
43 46
44 46
46 49
47 49
49 52
50 52
52 55
53 55
55 58
56 58
58 61
59 61
61 64
6...

result:

ok 

Subtask #7:

score: 5
Accepted

Test #31:

score: 5
Accepted
time: 802ms
memory: 4108kb

input:

1995 8

output:

2501
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1986 1988
1986 1989
1986 1990
1986 1991
1986 1992
1986 1993
1986 1994
1986 1995
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...

result:

ok 

Test #32:

score: 5
Accepted
time: 796ms
memory: 4220kb

input:

1999 8

output:

2506
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1990 1992
1990 1993
1990 1994
1990 1995
1990 1996
1990 1997
1990 1998
1990 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...

result:

ok 

Test #33:

score: 5
Accepted
time: 802ms
memory: 4216kb

input:

1987 8

output:

2491
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1978 1980
1978 1981
1978 1982
1978 1983
1978 1984
1978 1985
1978 1986
1978 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...

result:

ok 

Test #34:

score: 5
Accepted
time: 797ms
memory: 4220kb

input:

1981 8

output:

2481
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1972 1974
1972 1975
1972 1976
1972 1977
1972 1978
1972 1979
1972 1980
1972 1981
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...

result:

ok 

Test #35:

score: 5
Accepted
time: 795ms
memory: 4228kb

input:

1923 8

output:

2405
0 8
1 8
2 8
3 8
4 8
5 8
6 8
1914 1916
1914 1917
1914 1918
1914 1919
1914 1920
1914 1921
1914 1922
1914 1923
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...

result:

ok 

Subtask #8:

score: 5
Accepted

Test #36:

score: 5
Accepted
time: 799ms
memory: 4112kb

input:

1997 9

output:

2298
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1987 1989
1987 1990
1987 1991
1987 1992
1987 1993
1987 1994
1987 1995
1987 1996
10 13
11 13
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43
41 43
43 46
44 46
46 49
47 49
49 52
50 52
52...

result:

ok 

Test #37:

score: 5
Accepted
time: 803ms
memory: 4176kb

input:

1998 9

output:

2299
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
9 12
10 12
12 15
13 15
15 18
16 18
18 21
19 21
21 24
22 24
24 27
25 27
27 30
28 30
30 33
31 33
33 36
34 36
36 39
37 39
39 42
40 42
42 45
43 45
45 48
46 48
48 51
49 51
51 54
52 54
54 57
55 57
57...

result:

ok 

Test #38:

score: 5
Accepted
time: 800ms
memory: 4208kb

input:

1990 9

output:

2289
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
9 12
10 12
12 15
13 15
15 18
16 18
18 21
19 21
21 24
22 24
24 27
25 27
27 30
28 30
30 33
31 33
33 36
34 36
36 39
37 39
39 42
40 42
42 45
43 45
45 48
46 48
48 51
49 51
51 54
52 54
54 5...

result:

ok 

Test #39:

score: 5
Accepted
time: 801ms
memory: 4224kb

input:

1975 9

output:

2271
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
1965 1967
1965 1968
1965 1969
1965 1970
1965 1971
1965 1972
1965 1973
1965 1974
9 12
10 12
12 15
13 15
15 18
16 18
18 21
19 21
21 24
22 24
24 27
25 27
27 30
28 30
30 33
31 33
33 36
34 36
36 39
37 39
39 42
40 42
42 45
43 45
45 48
46 48
48 51
49 51
51 54
52 54
54 5...

result:

ok 

Test #40:

score: 5
Accepted
time: 803ms
memory: 4164kb

input:

1934 9

output:

2222
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1924 1926
1924 1927
1924 1928
1924 1929
1924 1930
1924 1931
1924 1932
1924 1933
10 13
11 13
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43
41 43
43 46
44 46
46 49
47 49
49 52
50 52
52...

result:

ok 

Subtask #9:

score: 4
Accepted

Test #41:

score: 4
Accepted
time: 833ms
memory: 4216kb

input:

1995 10

output:

2169
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1984 1986
1984 1987
1984 1988
1984 1989
1984 1990
1984 1991
1984 1992
1984 1993
1984 1994
10 13
11 13
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43
41 43
43 46
44 46
46 49
47 49
49 5...

result:

ok 

Test #42:

score: 4
Accepted
time: 800ms
memory: 4104kb

input:

1996 10

output:

2170
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1985 1987
1985 1988
1985 1989
1985 1990
1985 1991
1985 1992
1985 1993
1985 1994
1985 1995
11 14
12 14
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41
41 44
42 44
44 47
45 47
47 50
48 50...

result:

ok 

Test #43:

score: 4
Accepted
time: 788ms
memory: 4100kb

input:

1979 10

output:

2152
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
1969 1971
1969 1972
1969 1973
1969 1974
1969 1975
1969 1976
1969 1977
1969 1978
10 13
11 13
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43
41 43
43 46
44 46
46 49
47 49
49 52
50 52
52...

result:

ok 

Test #44:

score: 4
Accepted
time: 814ms
memory: 4108kb

input:

1972 10

output:

2144
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1961 1963
1961 1964
1961 1965
1961 1966
1961 1967
1961 1968
1961 1969
1961 1970
1961 1971
11 14
12 14
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41
41 44
42 44
44 47
45 47
47 50
48 50...

result:

ok 

Test #45:

score: 4
Accepted
time: 799ms
memory: 4164kb

input:

1945 10

output:

2114
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
11 14
12 14
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41
41 44
42 44
44 47
45 47
47 50
48 50...

result:

ok 

Subtask #10:

score: 4
Accepted

Test #46:

score: 4
Accepted
time: 800ms
memory: 4220kb

input:

1993 11

output:

2105
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1982 1984
1982 1985
1982 1986
1982 1987
1982 1988
1982 1989
1982 1990
1982 1991
1982 1992
11 14
12 14
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41
41 44
42 44
44 47
45 47
47 50
48 50...

result:

ok 

Test #47:

score: 4
Accepted
time: 796ms
memory: 4216kb

input:

1994 11

output:

2106
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1982 1984
1982 1985
1982 1986
1982 1987
1982 1988
1982 1989
1982 1990
1982 1991
1982 1992
1982 1993
11 14
12 14
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41
41 44
42 44
44 47
45 47
4...

result:

ok 

Test #48:

score: 4
Accepted
time: 791ms
memory: 4220kb

input:

2000 11

output:

2113
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1988 1990
1988 1991
1988 1992
1988 1993
1988 1994
1988 1995
1988 1996
1988 1997
1988 1998
1988 1999
11 14
12 14
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41
41 44
42 44
44 47
45 47
4...

result:

ok 

Test #49:

score: 4
Accepted
time: 830ms
memory: 4096kb

input:

1972 11

output:

2082
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
1961 1963
1961 1964
1961 1965
1961 1966
1961 1967
1961 1968
1961 1969
1961 1970
1961 1971
11 14
12 14
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41
41 44
42 44
44 47
45 47
47 50
48 50...

result:

ok 

Test #50:

score: 4
Accepted
time: 802ms
memory: 4108kb

input:

1944 11

output:

2052
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
12 15
13 15
15 18
16 18
18 21
19 21
21 24
22 24
24 27
25 27
27 30
28 30
30 33
31 33
33 36
34 36
36 39
37 39
39 42
40 42
42 45
43 45
45 48
4...

result:

ok 

Subtask #11:

score: 4
Accepted

Test #51:

score: 4
Accepted
time: 820ms
memory: 4164kb

input:

1999 12

output:

2051
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1986 1988
1986 1989
1986 1990
1986 1991
1986 1992
1986 1993
1986 1994
1986 1995
1986 1996
1986 1997
1986 1998
12 15
13 15
15 18
16 18
18 21
19 21
21 24
22 24
24 27
25 27
27 30
28 30
30 33
31 33
33 36
34 36
36 39
37 39
39 42
40 42
42 45
43 ...

result:

ok 

Test #52:

score: 4
Accepted
time: 797ms
memory: 4276kb

input:

2000 12

output:

2052
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1987 1989
1987 1990
1987 1991
1987 1992
1987 1993
1987 1994
1987 1995
1987 1996
1987 1997
1987 1998
1987 1999
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43
41 43
43 ...

result:

ok 

Test #53:

score: 4
Accepted
time: 791ms
memory: 4164kb

input:

1989 12

output:

2039
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
1977 1979
1977 1980
1977 1981
1977 1982
1977 1983
1977 1984
1977 1985
1977 1986
1977 1987
1977 1988
12 15
13 15
15 18
16 18
18 21
19 21
21 24
22 24
24 27
25 27
27 30
28 30
30 33
31 33
33 36
34 36
36 39
37 39
39 42
40 42
42 45
43 45
45 48
4...

result:

ok 

Test #54:

score: 4
Accepted
time: 799ms
memory: 4200kb

input:

1976 12

output:

2026
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1963 1965
1963 1966
1963 1967
1963 1968
1963 1969
1963 1970
1963 1971
1963 1972
1963 1973
1963 1974
1963 1975
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43
41 43
43 ...

result:

ok 

Test #55:

score: 4
Accepted
time: 792ms
memory: 4096kb

input:

1949 12

output:

1997
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
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43
41 43
43 ...

result:

ok 

Subtask #12:

score: 3
Accepted

Test #56:

score: 3
Accepted
time: 796ms
memory: 4192kb

input:

1981 13

output:

1998
0 14
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
1967 1969
1967 1970
1967 1971
1967 1972
1967 1973
1967 1974
1967 1975
1967 1976
1967 1977
1967 1978
1967 1979
1967 1980
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41...

result:

ok 

Test #57:

score: 3
Accepted
time: 805ms
memory: 4220kb

input:

1982 13

output:

1999
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1969 1971
1969 1972
1969 1973
1969 1974
1969 1975
1969 1976
1969 1977
1969 1978
1969 1979
1969 1980
1969 1981
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43
41 43
43 ...

result:

ok 

Test #58:

score: 3
Accepted
time: 798ms
memory: 4160kb

input:

1989 13

output:

2006
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1975 1977
1975 1978
1975 1979
1975 1980
1975 1981
1975 1982
1975 1983
1975 1984
1975 1985
1975 1986
1975 1987
1975 1988
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43...

result:

ok 

Test #59:

score: 3
Accepted
time: 832ms
memory: 4104kb

input:

1972 13

output:

1989
0 14
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
1958 1960
1958 1961
1958 1962
1958 1963
1958 1964
1958 1965
1958 1966
1958 1967
1958 1968
1958 1969
1958 1970
1958 1971
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41...

result:

ok 

Test #60:

score: 3
Accepted
time: 796ms
memory: 4088kb

input:

1929 13

output:

1944
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
1915 1917
1915 1918
1915 1919
1915 1920
1915 1921
1915 1922
1915 1923
1915 1924
1915 1925
1915 1926
1915 1927
1915 1928
13 16
14 16
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 37
35 37
37 40
38 40
40 43...

result:

ok 

Subtask #13:

score: 3
Accepted

Test #61:

score: 3
Accepted
time: 793ms
memory: 4104kb

input:

1979 14

output:

1976
0 14
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
1964 1966
1964 1967
1964 1968
1964 1969
1964 1970
1964 1971
1964 1972
1964 1973
1964 1974
1964 1975
1964 1976
1964 1977
1964 1978
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
3...

result:

ok 

Test #62:

score: 3
Accepted
time: 795ms
memory: 4096kb

input:

1980 14

output:

1977
0 15
1 15
2 15
3 15
4 15
5 15
6 15
7 15
8 15
9 15
10 15
11 15
12 15
13 15
1965 1967
1965 1968
1965 1969
1965 1970
1965 1971
1965 1972
1965 1973
1965 1974
1965 1975
1965 1976
1965 1977
1965 1978
1965 1979
15 18
16 18
18 21
19 21
21 24
22 24
24 27
25 27
27 30
28 30
30 33
31 33
33 36
34 36
36 39
3...

result:

ok 

Test #63:

score: 3
Accepted
time: 796ms
memory: 4108kb

input:

1987 14

output:

1984
0 14
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
1973 1975
1973 1976
1973 1977
1973 1978
1973 1979
1973 1980
1973 1981
1973 1982
1973 1983
1973 1984
1973 1985
1973 1986
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41...

result:

ok 

Test #64:

score: 3
Accepted
time: 802ms
memory: 4272kb

input:

1952 14

output:

1948
0 14
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
1937 1939
1937 1940
1937 1941
1937 1942
1937 1943
1937 1944
1937 1945
1937 1946
1937 1947
1937 1948
1937 1949
1937 1950
1937 1951
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
3...

result:

ok 

Test #65:

score: 3
Accepted
time: 796ms
memory: 4096kb

input:

1936 14

output:

1932
0 14
1 14
2 14
3 14
4 14
5 14
6 14
7 14
8 14
9 14
10 14
11 14
12 14
1922 1924
1922 1925
1922 1926
1922 1927
1922 1928
1922 1929
1922 1930
1922 1931
1922 1932
1922 1933
1922 1934
1922 1935
14 17
15 17
17 20
18 20
20 23
21 23
23 26
24 26
26 29
27 29
29 32
30 32
32 35
33 35
35 38
36 38
38 41
39 41...

result:

ok 

Subtask #14:

score: 3
Accepted

Test #66:

score: 3
Accepted
time: 797ms
memory: 4276kb

input:

2000 15

output:

1986
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
1984 1986
1984 1987
1984 1988
1984 1989
1984 1990
1984 1991
1984 1992
1984 1993
1984 1994
1984 1995
1984 1996
1984 1997
1984 1998
1984 1999
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 ...

result:

ok 

Test #67:

score: 3
Accepted
time: 797ms
memory: 4272kb

input:

1999 15

output:

1985
0 15
1 15
2 15
3 15
4 15
5 15
6 15
7 15
8 15
9 15
10 15
11 15
12 15
13 15
1983 1985
1983 1986
1983 1987
1983 1988
1983 1989
1983 1990
1983 1991
1983 1992
1983 1993
1983 1994
1983 1995
1983 1996
1983 1997
1983 1998
15 18
16 18
18 21
19 21
21 24
22 24
24 27
25 27
27 30
28 30
30 33
31 33
33 36
34 ...

result:

ok 

Test #68:

score: 3
Accepted
time: 797ms
memory: 4196kb

input:

1992 15

output:

1978
0 15
1 15
2 15
3 15
4 15
5 15
6 15
7 15
8 15
9 15
10 15
11 15
12 15
13 15
1977 1979
1977 1980
1977 1981
1977 1982
1977 1983
1977 1984
1977 1985
1977 1986
1977 1987
1977 1988
1977 1989
1977 1990
1977 1991
15 18
16 18
18 21
19 21
21 24
22 24
24 27
25 27
27 30
28 30
30 33
31 33
33 36
34 36
36 39
3...

result:

ok 

Test #69:

score: 3
Accepted
time: 811ms
memory: 4276kb

input:

1973 15

output:

1959
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
1957 1959
1957 1960
1957 1961
1957 1962
1957 1963
1957 1964
1957 1965
1957 1966
1957 1967
1957 1968
1957 1969
1957 1970
1957 1971
1957 1972
16 19
17 19
19 22
20 22
22 25
23 25
25 28
26 28
28 31
29 31
31 34
32 34
34 ...

result:

ok 

Test #70:

score: 3
Accepted
time: 798ms
memory: 4164kb

input:

1936 15

output:

1922
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
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
16 18
18 20
20 22
22 24
24 26
26 28
28 30
30 32
32 34
34 36
36 38...

result:

ok