QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#259523#3269. 末日魔法少女计划flower100 ✓412ms19936kbC++203.6kb2023-11-21 00:10:552023-11-21 00:10:56

详细

Subtask #1:

score: 22
Accepted

Test #1:

score: 22
Accepted
time: 369ms
memory: 19936kb

input:

2000 2

output:

15974
0 3
0 7
0 15
0 31
0 62
0 125
0 250
0 500
0 1000
1 3
1 7
1 15
1 31
1 62
1 125
1 250
1 500
1 1000
2 7
2 15
2 31
2 62
2 125
2 250
2 500
2 1000
3 5
3 6
3 7
3 15
3 31
3 62
3 125
3 250
3 500
3 1000
4 7
4 15
4 31
4 62
4 125
4 250
4 500
4 1000
5 7
5 15
5 31
5 62
5 125
5 250
5 500
5 1000
6 15
6 31
6 62...

result:

ok 

Test #2:

score: 22
Accepted
time: 369ms
memory: 19836kb

input:

1999 2

output:

15965
0 3
0 7
0 15
0 31
0 62
0 125
0 250
0 500
0 1000
1 3
1 7
1 15
1 31
1 62
1 125
1 250
1 500
1 1000
2 7
2 15
2 31
2 62
2 125
2 250
2 500
2 1000
3 5
3 6
3 7
3 15
3 31
3 62
3 125
3 250
3 500
3 1000
4 7
4 15
4 31
4 62
4 125
4 250
4 500
4 1000
5 7
5 15
5 31
5 62
5 125
5 250
5 500
5 1000
6 15
6 31
6 62...

result:

ok 

Test #3:

score: 22
Accepted
time: 369ms
memory: 19864kb

input:

1992 2

output:

15902
0 3
0 7
0 15
0 31
0 62
0 124
0 249
0 498
0 996
1 3
1 7
1 15
1 31
1 62
1 124
1 249
1 498
1 996
2 7
2 15
2 31
2 62
2 124
2 249
2 498
2 996
3 5
3 6
3 7
3 15
3 31
3 62
3 124
3 249
3 498
3 996
4 7
4 15
4 31
4 62
4 124
4 249
4 498
4 996
5 7
5 15
5 31
5 62
5 124
5 249
5 498
5 996
6 15
6 31
6 62
6 124...

result:

ok 

Test #4:

score: 22
Accepted
time: 370ms
memory: 19852kb

input:

1973 2

output:

15731
0 3
0 7
0 15
0 30
0 61
0 123
0 246
0 493
0 987
1 3
1 7
1 15
1 30
1 61
1 123
1 246
1 493
1 987
2 7
2 15
2 30
2 61
2 123
2 246
2 493
2 987
3 5
3 6
3 7
3 15
3 30
3 61
3 123
3 246
3 493
3 987
4 7
4 15
4 30
4 61
4 123
4 246
4 493
4 987
5 7
5 15
5 30
5 61
5 123
5 246
5 493
5 987
6 15
6 30
6 61
6 123...

result:

ok 

Test #5:

score: 22
Accepted
time: 371ms
memory: 19012kb

input:

1936 2

output:

15398
0 3
0 7
0 15
0 30
0 60
0 121
0 242
0 484
0 968
1 3
1 7
1 15
1 30
1 60
1 121
1 242
1 484
1 968
2 7
2 15
2 30
2 60
2 121
2 242
2 484
2 968
3 5
3 6
3 7
3 15
3 30
3 60
3 121
3 242
3 484
3 968
4 7
4 15
4 30
4 60
4 121
4 242
4 484
4 968
5 7
5 15
5 30
5 60
5 121
5 242
5 484
5 968
6 15
6 30
6 60
6 121...

result:

ok 

Subtask #2:

score: 14
Accepted

Test #6:

score: 14
Accepted
time: 373ms
memory: 19216kb

input:

1936 3

output:

7339
0 3
0 12
0 46
0 248
1 3
1 12
1 46
1 248
2 12
2 46
2 248
3 5
3 7
3 12
3 46
3 248
4 12
4 46
4 248
5 7
5 12
5 46
5 248
6 12
6 46
6 248
7 9
7 10
7 11
7 12
7 46
7 248
8 12
8 46
8 248
9 12
9 46
9 248
10 12
10 46
10 248
11 46
11 248
12 14
12 15
12 16
12 17
12 22
12 27
12 32
12 46
12 248
13 17
13 46
13...

result:

ok 

Test #7:

score: 14
Accepted
time: 369ms
memory: 18560kb

input:

2000 3

output:

7606
0 3
0 12
0 50
0 256
1 3
1 12
1 50
1 256
2 12
2 50
2 256
3 5
3 7
3 12
3 50
3 256
4 12
4 50
4 256
5 7
5 12
5 50
5 256
6 12
6 50
6 256
7 9
7 10
7 11
7 12
7 50
7 256
8 12
8 50
8 256
9 12
9 50
9 256
10 12
10 50
10 256
11 50
11 256
12 14
12 15
12 16
12 17
12 22
12 27
12 32
12 37
12 50
12 256
13 17
13...

result:

ok 

Test #8:

score: 14
Accepted
time: 372ms
memory: 18268kb

input:

1999 3

output:

7602
0 3
0 12
0 50
0 255
1 3
1 12
1 50
1 255
2 12
2 50
2 255
3 5
3 7
3 12
3 50
3 255
4 12
4 50
4 255
5 7
5 12
5 50
5 255
6 12
6 50
6 255
7 9
7 10
7 11
7 12
7 50
7 255
8 12
8 50
8 255
9 12
9 50
9 255
10 12
10 50
10 255
11 50
11 255
12 14
12 15
12 16
12 17
12 22
12 27
12 32
12 37
12 50
12 255
13 17
13...

result:

ok 

Test #9:

score: 14
Accepted
time: 369ms
memory: 19100kb

input:

1992 3

output:

7574
0 4
0 13
0 48
0 252
1 4
1 13
1 48
1 252
2 4
2 13
2 48
2 252
3 13
3 48
3 252
4 6
4 8
4 13
4 48
4 252
5 13
5 48
5 252
6 8
6 13
6 48
6 252
7 13
7 48
7 252
8 10
8 11
8 12
8 13
8 48
8 252
9 13
9 48
9 252
10 13
10 48
10 252
11 13
11 48
11 252
12 48
12 252
13 15
13 16
13 17
13 18
13 23
13 28
13 33
13 ...

result:

ok 

Test #10:

score: 14
Accepted
time: 409ms
memory: 19012kb

input:

1973 3

output:

7494
0 3
0 12
0 50
0 242
1 3
1 12
1 50
1 242
2 12
2 50
2 242
3 5
3 7
3 12
3 50
3 242
4 12
4 50
4 242
5 7
5 12
5 50
5 242
6 12
6 50
6 242
7 9
7 10
7 11
7 12
7 50
7 242
8 12
8 50
8 242
9 12
9 50
9 242
10 12
10 50
10 242
11 50
11 242
12 14
12 15
12 16
12 17
12 22
12 27
12 32
12 37
12 50
12 242
13 17
13...

result:

ok 

Subtask #3:

score: 11
Accepted

Test #11:

score: 11
Accepted
time: 368ms
memory: 19204kb

input:

2000 4

output:

4792
0 5
0 37
1 5
1 37
2 5
2 37
3 5
3 37
4 37
5 7
5 11
5 19
5 37
6 37
7 9
7 11
7 19
7 37
8 37
9 11
9 19
9 37
10 37
11 13
11 15
11 17
11 19
11 37
12 37
13 15
13 19
13 37
14 37
15 17
15 19
15 37
16 37
17 19
17 37
18 37
19 21
19 23
19 25
19 27
19 29
19 31
19 37
20 37
21 23
21 27
21 37
22 37
23 25
23 27...

result:

ok 

Test #12:

score: 11
Accepted
time: 368ms
memory: 19368kb

input:

1999 4

output:

4789
0 5
0 39
1 5
1 39
2 5
2 39
3 5
3 39
4 39
5 7
5 11
5 19
5 39
6 39
7 9
7 11
7 19
7 39
8 39
9 11
9 19
9 39
10 39
11 13
11 15
11 17
11 19
11 39
12 39
13 15
13 19
13 39
14 39
15 17
15 19
15 39
16 39
17 19
17 39
18 39
19 21
19 23
19 25
19 27
19 29
19 31
19 33
19 39
20 39
21 23
21 27
21 39
22 39
23 25...

result:

ok 

Test #13:

score: 11
Accepted
time: 368ms
memory: 18444kb

input:

1991 4

output:

4768
0 4
0 38
1 4
1 38
2 4
2 38
3 38
4 6
4 10
4 18
4 38
5 38
6 8
6 10
6 18
6 38
7 38
8 10
8 18
8 38
9 38
10 12
10 14
10 16
10 18
10 38
11 38
12 14
12 18
12 38
13 38
14 16
14 18
14 38
15 38
16 18
16 38
17 38
18 20
18 22
18 24
18 26
18 28
18 30
18 32
18 38
19 38
20 22
20 26
20 38
21 38
22 24
22 26
22 ...

result:

ok 

Test #14:

score: 11
Accepted
time: 404ms
memory: 19296kb

input:

1971 4

output:

4715
0 5
0 37
1 5
1 37
2 5
2 37
3 5
3 37
4 37
5 7
5 11
5 19
5 37
6 37
7 9
7 11
7 19
7 37
8 37
9 11
9 19
9 37
10 37
11 13
11 15
11 17
11 19
11 37
12 37
13 15
13 19
13 37
14 37
15 17
15 19
15 37
16 37
17 19
17 37
18 37
19 21
19 23
19 25
19 27
19 29
19 31
19 37
20 37
21 23
21 27
21 37
22 37
23 25
23 27...

result:

ok 

Test #15:

score: 11
Accepted
time: 368ms
memory: 19160kb

input:

1938 4

output:

4626
0 5
0 39
1 5
1 39
2 5
2 39
3 5
3 39
4 39
5 7
5 11
5 19
5 39
6 39
7 9
7 11
7 19
7 39
8 39
9 11
9 19
9 39
10 39
11 13
11 15
11 17
11 19
11 39
12 39
13 15
13 19
13 39
14 39
15 17
15 19
15 39
16 39
17 19
17 39
18 39
19 21
19 23
19 25
19 27
19 29
19 31
19 33
19 39
20 39
21 23
21 27
21 39
22 39
23 25...

result:

ok 

Subtask #4:

score: 9
Accepted

Test #16:

score: 9
Accepted
time: 407ms
memory: 19048kb

input:

2000 5

output:

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

result:

ok 

Test #17:

score: 9
Accepted
time: 393ms
memory: 19104kb

input:

1999 5

output:

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

result:

ok 

Test #18:

score: 9
Accepted
time: 376ms
memory: 19084kb

input:

1992 5

output:

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

result:

ok 

Test #19:

score: 9
Accepted
time: 364ms
memory: 19188kb

input:

1973 5

output:

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

result:

ok 

Test #20:

score: 9
Accepted
time: 384ms
memory: 18828kb

input:

1936 5

output:

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

result:

ok 

Subtask #5:

score: 7
Accepted

Test #21:

score: 7
Accepted
time: 370ms
memory: 19152kb

input:

2000 6

output:

3213
0 7
1 7
2 7
3 7
4 7
5 7
7 9
7 17
7 81
9 11
9 17
9 81
11 13
11 17
11 81
13 15
13 17
13 81
15 17
15 81
17 19
17 21
17 29
17 45
17 81
19 21
19 81
21 23
21 25
21 29
21 45
21 81
23 25
23 81
25 27
25 29
25 45
25 81
27 29
27 81
29 31
29 33
29 37
29 41
29 45
29 81
31 33
31 81
33 35
33 37
33 45
33 81
35...

result:

ok 

Test #22:

score: 7
Accepted
time: 364ms
memory: 18972kb

input:

1997 6

output:

3208
0 6
1 6
2 6
3 6
4 6
6 8
6 16
6 80
8 10
8 16
8 80
10 12
10 16
10 80
12 14
12 16
12 80
14 16
14 80
16 18
16 20
16 28
16 44
16 80
18 20
18 80
20 22
20 24
20 28
20 44
20 80
22 24
22 80
24 26
24 28
24 44
24 80
26 28
26 80
28 30
28 32
28 36
28 40
28 44
28 80
30 32
30 80
32 34
32 36
32 44
32 80
34 36
...

result:

ok 

Test #23:

score: 7
Accepted
time: 371ms
memory: 19140kb

input:

1989 6

output:

3194
0 6
1 6
2 6
3 6
4 6
6 8
6 16
6 76
8 10
8 16
8 76
10 12
10 16
10 76
12 14
12 16
12 76
14 16
14 76
16 18
16 20
16 28
16 40
16 76
18 20
18 76
20 22
20 24
20 28
20 40
20 76
22 24
22 76
24 26
24 28
24 40
24 76
26 28
26 76
28 30
28 32
28 36
28 40
28 76
30 32
30 76
32 34
32 36
32 40
32 76
34 36
34 76
...

result:

ok 

Test #24:

score: 7
Accepted
time: 367ms
memory: 19120kb

input:

1972 6

output:

3164
0 7
1 7
2 7
3 7
4 7
5 7
7 9
7 15
7 79
9 11
9 15
9 79
11 13
11 15
11 79
13 15
13 79
15 17
15 19
15 27
15 43
15 79
17 19
17 79
19 21
19 23
19 27
19 43
19 79
21 23
21 79
23 25
23 27
23 43
23 79
25 27
25 79
27 29
27 31
27 35
27 39
27 43
27 79
29 31
29 79
31 33
31 35
31 43
31 79
33 35
33 79
35 37
35...

result:

ok 

Test #25:

score: 7
Accepted
time: 367ms
memory: 19220kb

input:

1933 6

output:

3096
0 6
1 6
2 6
3 6
4 6
6 8
6 16
6 84
8 10
8 16
8 84
10 12
10 16
10 84
12 14
12 16
12 84
14 16
14 84
16 18
16 20
16 28
16 44
16 84
18 20
18 84
20 22
20 24
20 28
20 44
20 84
22 24
22 84
24 26
24 28
24 44
24 84
26 28
26 84
28 30
28 32
28 36
28 40
28 44
28 84
30 32
30 84
32 34
32 36
32 44
32 84
34 36
...

result:

ok 

Subtask #6:

score: 6
Accepted

Test #26:

score: 6
Accepted
time: 372ms
memory: 19372kb

input:

1999 7

output:

2901
0 7
1 7
2 7
3 7
4 7
5 7
7 9
7 17
7 79
9 11
9 17
9 79
11 13
11 17
11 79
13 15
13 17
13 79
15 17
15 79
17 19
17 21
17 33
17 79
19 21
19 79
21 23
21 25
21 33
21 79
23 25
23 79
25 27
25 29
25 33
25 79
27 29
27 79
29 31
29 33
29 79
31 33
31 79
33 35
33 37
33 41
33 49
33 79
35 37
35 79
37 39
37 41
37...

result:

ok 

Test #27:

score: 6
Accepted
time: 368ms
memory: 19160kb

input:

1997 7

output:

2898
0 7
1 7
2 7
3 7
4 7
5 7
7 9
7 19
7 77
9 11
9 19
9 77
11 13
11 19
11 77
13 15
13 19
13 77
15 17
15 19
15 77
17 19
17 77
19 21
19 23
19 31
19 77
21 23
21 77
23 25
23 27
23 31
23 77
25 27
25 77
27 29
27 31
27 77
29 31
29 77
31 33
31 35
31 39
31 47
31 77
33 35
33 77
35 37
35 39
35 77
37 39
37 77
39...

result:

ok 

Test #28:

score: 6
Accepted
time: 368ms
memory: 19088kb

input:

1987 7

output:

2883
0 7
1 7
2 7
3 7
4 7
5 7
7 9
7 19
7 77
9 11
9 19
9 77
11 13
11 19
11 77
13 15
13 19
13 77
15 17
15 19
15 77
17 19
17 77
19 21
19 23
19 31
19 77
21 23
21 77
23 25
23 27
23 31
23 77
25 27
25 77
27 29
27 31
27 77
29 31
29 77
31 33
31 35
31 39
31 47
31 77
33 35
33 77
35 37
35 39
35 77
37 39
37 77
39...

result:

ok 

Test #29:

score: 6
Accepted
time: 368ms
memory: 19092kb

input:

1978 7

output:

2869
0 8
1 8
2 8
3 8
4 8
5 8
6 8
8 10
8 20
8 78
10 12
10 20
10 78
12 14
12 20
12 78
14 16
14 20
14 78
16 18
16 20
16 78
18 20
18 78
20 22
20 24
20 32
20 78
22 24
22 78
24 26
24 28
24 32
24 78
26 28
26 78
28 30
28 32
28 78
30 32
30 78
32 34
32 36
32 40
32 48
32 78
34 36
34 78
36 38
36 40
36 78
38 40
...

result:

ok 

Test #30:

score: 6
Accepted
time: 368ms
memory: 19052kb

input:

1931 7

output:

2799
0 7
1 7
2 7
3 7
4 7
5 7
7 9
7 17
7 79
9 11
9 17
9 79
11 13
11 17
11 79
13 15
13 17
13 79
15 17
15 79
17 19
17 21
17 33
17 79
19 21
19 79
21 23
21 25
21 33
21 79
23 25
23 79
25 27
25 29
25 33
25 79
27 29
27 79
29 31
29 33
29 79
31 33
31 79
33 35
33 37
33 41
33 49
33 79
35 37
35 79
37 39
37 41
37...

result:

ok 

Subtask #7:

score: 5
Accepted

Test #31:

score: 5
Accepted
time: 368ms
memory: 19104kb

input:

1995 8

output:

2501
0 8
1 8
2 8
3 8
4 8
5 8
6 8
8 10
8 20
10 12
10 20
12 14
12 20
14 16
14 20
16 18
16 20
18 20
20 22
20 24
20 40
20 120
22 24
24 26
24 28
24 40
24 120
26 28
28 30
28 32
28 40
28 120
30 32
32 34
32 36
32 40
32 120
34 36
36 38
36 40
36 120
38 40
40 42
40 44
40 48
40 56
40 72
40 120
42 44
44 46
44 48...

result:

ok 

Test #32:

score: 5
Accepted
time: 388ms
memory: 18976kb

input:

1999 8

output:

2506
0 8
1 8
2 8
3 8
4 8
5 8
6 8
8 10
8 20
10 12
10 20
12 14
12 20
14 16
14 20
16 18
16 20
18 20
20 22
20 24
20 36
20 108
22 24
24 26
24 28
24 36
24 108
26 28
28 30
28 32
28 36
28 108
30 32
32 34
32 36
32 108
34 36
36 38
36 40
36 44
36 60
36 108
38 40
40 42
40 44
40 108
42 44
44 46
44 48
44 52
44 60...

result:

ok 

Test #33:

score: 5
Accepted
time: 383ms
memory: 19076kb

input:

1987 8

output:

2490
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
9 11
9 23
11 13
11 23
13 15
13 23
15 17
15 23
17 19
17 23
19 21
19 23
21 23
23 25
23 27
23 43
23 115
25 27
27 29
27 31
27 43
27 115
29 31
31 33
31 35
31 43
31 115
33 35
35 37
35 39
35 43
35 115
37 39
39 41
39 43
39 115
41 43
43 45
43 47
43 51
43 67
43 115
45 47
4...

result:

ok 

Test #34:

score: 5
Accepted
time: 368ms
memory: 18012kb

input:

1981 8

output:

2481
0 8
1 8
2 8
3 8
4 8
5 8
6 8
8 10
8 22
10 12
10 22
12 14
12 22
14 16
14 22
16 18
16 22
18 20
18 22
20 22
22 24
22 26
22 42
22 114
24 26
26 28
26 30
26 42
26 114
28 30
30 32
30 34
30 42
30 114
32 34
34 36
34 38
34 42
34 114
36 38
38 40
38 42
38 114
40 42
42 44
42 46
42 50
42 66
42 114
44 46
46 48...

result:

ok 

Test #35:

score: 5
Accepted
time: 406ms
memory: 18824kb

input:

1923 8

output:

2405
0 8
1 8
2 8
3 8
4 8
5 8
6 8
8 10
8 20
10 12
10 20
12 14
12 20
14 16
14 20
16 18
16 20
18 20
20 22
20 24
20 40
20 120
22 24
24 26
24 28
24 40
24 120
26 28
28 30
28 32
28 40
28 120
30 32
32 34
32 36
32 40
32 120
34 36
36 38
36 40
36 120
38 40
40 42
40 44
40 48
40 56
40 72
40 120
42 44
44 46
44 48...

result:

ok 

Subtask #8:

score: 5
Accepted

Test #36:

score: 5
Accepted
time: 365ms
memory: 19336kb

input:

1997 9

output:

2392
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
9 11
9 23
11 13
11 23
13 15
13 23
15 17
15 23
17 19
17 23
19 21
19 23
21 23
23 25
23 27
23 43
23 167
25 27
27 29
27 31
27 43
27 167
29 31
31 33
31 35
31 43
31 167
33 35
35 37
35 39
35 43
35 167
37 39
39 41
39 43
39 167
41 43
43 45
43 47
43 51
43 75
43 167
45 47
4...

result:

ok 

Test #37:

score: 5
Accepted
time: 397ms
memory: 19136kb

input:

1998 9

output:

2393
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
10 12
10 24
12 14
12 24
14 16
14 24
16 18
16 24
18 20
18 24
20 22
20 24
22 24
24 26
24 28
24 44
24 168
26 28
28 30
28 32
28 44
28 168
30 32
32 34
32 36
32 44
32 168
34 36
36 38
36 40
36 44
36 168
38 40
40 42
40 44
40 168
42 44
44 46
44 48
44 52
44 76...

result:

ok 

Test #38:

score: 5
Accepted
time: 368ms
memory: 19008kb

input:

1990 9

output:

2383
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
10 12
10 24
12 14
12 24
14 16
14 24
16 18
16 24
18 20
18 24
20 22
20 24
22 24
24 26
24 28
24 44
24 168
26 28
28 30
28 32
28 44
28 168
30 32
32 34
32 36
32 44
32 168
34 36
36 38
36 40
36 44
36 168
38 40
40 42
40 44
40 168
42 44
44 46
44 48
44 52
44 76...

result:

ok 

Test #39:

score: 5
Accepted
time: 368ms
memory: 19012kb

input:

1975 9

output:

2364
0 9
1 9
2 9
3 9
4 9
5 9
6 9
7 9
9 11
9 25
11 13
11 25
13 15
13 25
15 17
15 25
17 19
17 25
19 21
19 25
21 23
21 25
23 25
25 27
25 29
25 45
25 169
27 29
29 31
29 33
29 45
29 169
31 33
33 35
33 37
33 45
33 169
35 37
37 39
37 41
37 45
37 169
39 41
41 43
41 45
41 169
43 45
45 47
45 49
45 53
45 77
45...

result:

ok 

Test #40:

score: 5
Accepted
time: 368ms
memory: 19216kb

input:

1934 9

output:

2313
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
10 12
10 24
12 14
12 24
14 16
14 24
16 18
16 24
18 20
18 24
20 22
20 24
22 24
24 26
24 28
24 44
24 168
26 28
28 30
28 32
28 44
28 168
30 32
32 34
32 36
32 44
32 168
34 36
36 38
36 40
36 44
36 168
38 40
40 42
40 44
40 168
42 44
44 46
44 48
44 52
44 76...

result:

ok 

Subtask #9:

score: 4
Accepted

Test #41:

score: 4
Accepted
time: 368ms
memory: 19044kb

input:

1995 10

output:

2193
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
10 12
10 26
12 14
12 26
14 16
14 26
16 18
16 26
18 20
18 26
20 22
20 26
22 24
22 26
24 26
26 28
26 30
26 50
28 30
30 32
30 34
30 50
32 34
34 36
34 38
34 50
36 38
38 40
38 42
38 50
40 42
42 44
42 46
42 50
44 46
46 48
46 50
48 50
50 52
50 54
50 58
50 8...

result:

ok 

Test #42:

score: 4
Accepted
time: 367ms
memory: 18952kb

input:

1996 10

output:

2194
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
11 13
11 27
13 15
13 27
15 17
15 27
17 19
17 27
19 21
19 27
21 23
21 27
23 25
23 27
25 27
27 29
27 31
27 51
29 31
31 33
31 35
31 51
33 35
35 37
35 39
35 51
37 39
39 41
39 43
39 51
41 43
43 45
43 47
43 51
45 47
47 49
47 51
49 51
51 53
51 55
51 59...

result:

ok 

Test #43:

score: 4
Accepted
time: 410ms
memory: 19236kb

input:

1979 10

output:

2175
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
10 12
10 26
12 14
12 26
14 16
14 26
16 18
16 26
18 20
18 26
20 22
20 26
22 24
22 26
24 26
26 28
26 30
26 50
28 30
30 32
30 34
30 50
32 34
34 36
34 38
34 50
36 38
38 40
38 42
38 50
40 42
42 44
42 46
42 50
44 46
46 48
46 50
48 50
50 52
50 54
50 58
50 9...

result:

ok 

Test #44:

score: 4
Accepted
time: 367ms
memory: 19160kb

input:

1972 10

output:

2166
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
11 13
11 29
13 15
13 29
15 17
15 29
17 19
17 29
19 21
19 29
21 23
21 29
23 25
23 29
25 27
25 29
27 29
29 31
29 33
29 57
31 33
33 35
33 37
33 57
35 37
37 39
37 41
37 57
39 41
41 43
41 45
41 57
43 45
45 47
45 49
45 57
47 49
49 51
49 53
49 57
51 53...

result:

ok 

Test #45:

score: 4
Accepted
time: 372ms
memory: 18844kb

input:

1945 10

output:

2135
0 10
1 10
2 10
3 10
4 10
5 10
6 10
7 10
8 10
10 12
10 28
12 14
12 28
14 16
14 28
16 18
16 28
18 20
18 28
20 22
20 28
22 24
22 28
24 26
24 28
26 28
28 30
28 32
28 56
30 32
32 34
32 36
32 56
34 36
36 38
36 40
36 56
38 40
40 42
40 44
40 56
42 44
44 46
44 48
44 56
46 48
48 50
48 52
48 56
50 52
52 5...

result:

ok 

Subtask #10:

score: 4
Accepted

Test #46:

score: 4
Accepted
time: 393ms
memory: 19108kb

input:

1993 11

output:

2133
0 11
1 11
2 11
3 11
4 11
5 11
6 11
7 11
8 11
9 11
11 13
11 29
13 15
13 29
15 17
15 29
17 19
17 29
19 21
19 29
21 23
21 29
23 25
23 29
25 27
25 29
27 29
29 31
29 33
29 57
31 33
33 35
33 37
33 57
35 37
37 39
37 41
37 57
39 41
41 43
41 45
41 57
43 45
45 47
45 49
45 57
47 49
49 51
49 53
49 57
51 53...

result:

ok 

Test #47:

score: 4
Accepted
time: 376ms
memory: 19080kb

input:

1994 11

output:

2134
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
12 14
12 30
14 16
14 30
16 18
16 30
18 20
18 30
20 22
20 30
22 24
22 30
24 26
24 30
26 28
26 30
28 30
30 32
30 34
30 58
32 34
34 36
34 38
34 58
36 38
38 40
38 42
38 58
40 42
42 44
42 46
42 58
44 46
46 48
46 50
46 58
48 50
50 52
50 54
50 58...

result:

ok 

Test #48:

score: 4
Accepted
time: 403ms
memory: 19180kb

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
12 14
12 32
14 16
14 32
16 18
16 32
18 20
18 32
20 22
20 32
22 24
22 32
24 26
24 32
26 28
26 32
28 30
28 32
30 32
32 34
32 36
32 64
34 36
36 38
36 40
36 64
38 40
40 42
40 44
40 64
42 44
44 46
44 48
44 64
46 48
48 50
48 52
48 64
50 52
52 54...

result:

ok 

Test #49:

score: 4
Accepted
time: 364ms
memory: 19068kb

input:

1972 11

output:

2109
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
12 14
12 32
14 16
14 32
16 18
16 32
18 20
18 32
20 22
20 32
22 24
22 32
24 26
24 32
26 28
26 32
28 30
28 32
30 32
32 34
32 36
32 60
34 36
36 38
36 40
36 60
38 40
40 42
40 44
40 60
42 44
44 46
44 48
44 60
46 48
48 50
48 52
48 60
50 52
52 54...

result:

ok 

Test #50:

score: 4
Accepted
time: 361ms
memory: 18864kb

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
12 14
12 32
14 16
14 32
16 18
16 32
18 20
18 32
20 22
20 32
22 24
22 32
24 26
24 32
26 28
26 32
28 30
28 32
30 32
32 34
32 36
32 64
34 36
36 38
36 40
36 64
38 40
40 42
40 44
40 64
42 44
44 46
44 48
44 64
46 48
48 50
48 52
48 64
50 52
52 54...

result:

ok 

Subtask #11:

score: 4
Accepted

Test #51:

score: 4
Accepted
time: 373ms
memory: 19096kb

input:

1999 12

output:

2067
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
12 14
12 32
14 16
14 32
16 18
16 32
18 20
18 32
20 22
20 32
22 24
22 32
24 26
24 32
26 28
26 32
28 30
28 32
30 32
32 34
32 36
32 64
34 36
36 38
36 40
36 64
38 40
40 42
40 44
40 64
42 44
44 46
44 48
44 64
46 48
48 50
48 52
48 64
50 52
52 54...

result:

ok 

Test #52:

score: 4
Accepted
time: 378ms
memory: 19120kb

input:

2000 12

output:

2068
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
13 15
13 33
15 17
15 33
17 19
17 33
19 21
19 33
21 23
21 33
23 25
23 33
25 27
25 33
27 29
27 33
29 31
29 33
31 33
33 35
33 37
33 65
35 37
37 39
37 41
37 65
39 41
41 43
41 45
41 65
43 45
45 47
45 49
45 65
47 49
49 51
49 53
49 65
51 53...

result:

ok 

Test #53:

score: 4
Accepted
time: 368ms
memory: 19084kb

input:

1989 12

output:

2056
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
12 14
12 34
14 16
14 34
16 18
16 34
18 20
18 34
20 22
20 34
22 24
22 34
24 26
24 34
26 28
26 34
28 30
28 34
30 32
30 34
32 34
34 36
34 38
34 70
36 38
38 40
38 42
38 70
40 42
42 44
42 46
42 70
44 46
46 48
46 50
46 70
48 50
50 52
50 54
50 70...

result:

ok 

Test #54:

score: 4
Accepted
time: 367ms
memory: 19024kb

input:

1976 12

output:

2042
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
13 15
13 33
15 17
15 33
17 19
17 33
19 21
19 33
21 23
21 33
23 25
23 33
25 27
25 33
27 29
27 33
29 31
29 33
31 33
33 35
33 37
33 65
35 37
37 39
37 41
37 65
39 41
41 43
41 45
41 65
43 45
45 47
45 49
45 65
47 49
49 51
49 53
49 65
51 53...

result:

ok 

Test #55:

score: 4
Accepted
time: 396ms
memory: 17912kb

input:

1949 12

output:

2013
0 12
1 12
2 12
3 12
4 12
5 12
6 12
7 12
8 12
9 12
10 12
12 14
12 34
14 16
14 34
16 18
16 34
18 20
18 34
20 22
20 34
22 24
22 34
24 26
24 34
26 28
26 34
28 30
28 34
30 32
30 34
32 34
34 36
34 38
34 70
36 38
38 40
38 42
38 70
40 42
42 44
42 46
42 70
44 46
46 48
46 50
46 70
48 50
50 52
50 54
50 70...

result:

ok 

Subtask #12:

score: 3
Accepted

Test #56:

score: 3
Accepted
time: 368ms
memory: 19000kb

input:

1981 13

output:

2004
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
13 15
13 35
15 17
15 35
17 19
17 35
19 21
19 35
21 23
21 35
23 25
23 35
25 27
25 35
27 29
27 35
29 31
29 35
31 33
31 35
33 35
35 37
35 39
35 71
37 39
39 41
39 43
39 71
41 43
43 45
43 47
43 71
45 47
47 49
47 51
47 71
49 51
51 53
51 55...

result:

ok 

Test #57:

score: 3
Accepted
time: 367ms
memory: 18992kb

input:

1982 13

output:

2005
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
14 16
14 36
16 18
16 36
18 20
18 36
20 22
20 36
22 24
22 36
24 26
24 36
26 28
26 36
28 30
28 36
30 32
30 36
32 34
32 36
34 36
36 38
36 40
36 72
38 40
40 42
40 44
40 72
42 44
44 46
44 48
44 72
46 48
48 50
48 52
48 72
50 52
52 54...

result:

ok 

Test #58:

score: 3
Accepted
time: 368ms
memory: 18216kb

input:

1989 13

output:

2012
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
13 15
13 35
15 17
15 35
17 19
17 35
19 21
19 35
21 23
21 35
23 25
23 35
25 27
25 35
27 29
27 35
29 31
29 35
31 33
31 35
33 35
35 37
35 39
35 71
37 39
39 41
39 43
39 71
41 43
43 45
43 47
43 71
45 47
47 49
47 51
47 71
49 51
51 53
51 55...

result:

ok 

Test #59:

score: 3
Accepted
time: 379ms
memory: 19032kb

input:

1972 13

output:

1994
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
14 16
14 38
16 18
16 38
18 20
18 38
20 22
20 38
22 24
22 38
24 26
24 38
26 28
26 38
28 30
28 38
30 32
30 38
32 34
32 38
34 36
34 38
36 38
38 40
38 42
38 78
40 42
42 44
42 46
42 78
44 46
46 48
46 50
46 78
48 50
50 52
50 54
50 78...

result:

ok 

Test #60:

score: 3
Accepted
time: 394ms
memory: 19080kb

input:

1929 13

output:

1949
0 13
1 13
2 13
3 13
4 13
5 13
6 13
7 13
8 13
9 13
10 13
11 13
13 15
13 35
15 17
15 35
17 19
17 35
19 21
19 35
21 23
21 35
23 25
23 35
25 27
25 35
27 29
27 35
29 31
29 35
31 33
31 35
33 35
35 37
35 39
35 75
37 39
39 41
39 43
39 75
41 43
43 45
43 47
43 75
45 47
47 49
47 51
47 75
49 51
51 53
51 55...

result:

ok 

Subtask #13:

score: 3
Accepted

Test #61:

score: 3
Accepted
time: 411ms
memory: 19140kb

input:

1979 14

output:

1981
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
14 16
14 38
16 18
16 38
18 20
18 38
20 22
20 38
22 24
22 38
24 26
24 38
26 28
26 38
28 30
28 38
30 32
30 38
32 34
32 38
34 36
34 38
36 38
38 40
38 42
38 78
40 42
42 44
42 46
42 78
44 46
46 48
46 50
46 78
48 50
50 52
50 54
50 78...

result:

ok 

Test #62:

score: 3
Accepted
time: 367ms
memory: 19060kb

input:

1980 14

output:

1982
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
15 17
15 39
17 19
17 39
19 21
19 39
21 23
21 39
23 25
23 39
25 27
25 39
27 29
27 39
29 31
29 39
31 33
31 39
33 35
33 39
35 37
35 39
37 39
39 41
39 43
39 79
41 43
43 45
43 47
43 79
45 47
47 49
47 51
47 79
49 51
51 53
51 55...

result:

ok 

Test #63:

score: 3
Accepted
time: 367ms
memory: 19304kb

input:

1987 14

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
14 16
14 38
16 18
16 38
18 20
18 38
20 22
20 38
22 24
22 38
24 26
24 38
26 28
26 38
28 30
28 38
30 32
30 38
32 34
32 38
34 36
34 38
36 38
38 40
38 42
38 78
40 42
42 44
42 46
42 78
44 46
46 48
46 50
46 78
48 50
50 52
50 54
50 78...

result:

ok 

Test #64:

score: 3
Accepted
time: 367ms
memory: 18852kb

input:

1952 14

output:

1953
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
15 17
15 39
17 19
17 39
19 21
19 39
21 23
21 39
23 25
23 39
25 27
25 39
27 29
27 39
29 31
29 39
31 33
31 39
33 35
33 39
35 37
35 39
37 39
39 41
39 43
39 83
41 43
43 45
43 47
43 83
45 47
47 49
47 51
47 83
49 51
51 53
51 55...

result:

ok 

Test #65:

score: 3
Accepted
time: 385ms
memory: 17812kb

input:

1936 14

output:

1936
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
15 17
15 39
17 19
17 39
19 21
19 39
21 23
21 39
23 25
23 39
25 27
25 39
27 29
27 39
29 31
29 39
31 33
31 39
33 35
33 39
35 37
35 39
37 39
39 41
39 43
39 83
41 43
43 45
43 47
43 83
45 47
47 49
47 51
47 83
49 51
51 53
51 55...

result:

ok 

Subtask #14:

score: 3
Accepted

Test #66:

score: 3
Accepted
time: 367ms
memory: 19072kb

input:

2000 15

output:

1988
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
16 18
16 44
18 20
18 44
20 22
20 44
22 24
22 44
24 26
24 44
26 28
26 44
28 30
28 44
30 32
30 44
32 34
32 44
34 36
34 44
36 38
36 44
38 40
38 44
40 42
40 44
42 44
44 46
44 48
44 92
46 48
48 50
48 52
48 92
50 52
52 54...

result:

ok 

Test #67:

score: 3
Accepted
time: 367ms
memory: 19100kb

input:

1999 15

output:

1987
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
15 17
15 43
17 19
17 43
19 21
19 43
21 23
21 43
23 25
23 43
25 27
25 43
27 29
27 43
29 31
29 43
31 33
31 43
33 35
33 43
35 37
35 43
37 39
37 43
39 41
39 43
41 43
43 45
43 47
43 91
45 47
47 49
47 51
47 91
49 51
51 53
51 55...

result:

ok 

Test #68:

score: 3
Accepted
time: 367ms
memory: 19012kb

input:

1992 15

output:

1980
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
16 18
16 44
18 20
18 44
20 22
20 44
22 24
22 44
24 26
24 44
26 28
26 44
28 30
28 44
30 32
30 44
32 34
32 44
34 36
34 44
36 38
36 44
38 40
38 44
40 42
40 44
42 44
44 46
44 48
44 92
46 48
48 50
48 52
48 92
50 52
52 54...

result:

ok 

Test #69:

score: 3
Accepted
time: 412ms
memory: 18940kb

input:

1973 15

output:

1961
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
15 17
15 41
17 19
17 41
19 21
19 41
21 23
21 41
23 25
23 41
25 27
25 41
27 29
27 41
29 31
29 41
31 33
31 41
33 35
33 41
35 37
35 41
37 39
37 41
39 41
41 43
41 45
41 89
43 45
45 47
45 49
45 89
47 49
49 51
49 53
49 89
51 53...

result:

ok 

Test #70:

score: 3
Accepted
time: 377ms
memory: 19076kb

input:

1936 15

output:

1923
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
16 18
16 44
18 20
18 44
20 22
20 44
22 24
22 44
24 26
24 44
26 28
26 44
28 30
28 44
30 32
30 44
32 34
32 44
34 36
34 44
36 38
36 44
38 40
38 44
40 42
40 44
42 44
44 46
44 48
44 92
46 48
48 50
48 52
48 92
50 52
52 54...

result:

ok