QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#510658#5209. King's PuzzleZhangYiDeAC ✓5ms5424kbC++201.5kb2024-08-09 10:25:572024-08-09 10:25:58

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5 2

output:

YES
4
1 2
2 3
3 4
4 5

result:

ok n = 5, k = 2: nice job dude

Test #2:

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

input:

4 1

output:

YES
4
1 2
2 3
3 4
4 1

result:

ok n = 4, k = 1: nice job dude

Test #3:

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

input:

11 1

output:

YES
11
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 1

result:

ok n = 11, k = 1: nice job dude

Test #4:

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

input:

11 2

output:

YES
10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11

result:

ok n = 11, k = 2: nice job dude

Test #5:

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

input:

11 3

output:

YES
11
1 4
2 4
3 4
2 3
1 5
5 6
6 7
7 8
8 9
9 10
10 11

result:

ok n = 11, k = 3: nice job dude

Test #6:

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

input:

11 9

output:

YES
26
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
1 11

result:

ok n = 11, k = 9: nice job dude

Test #7:

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

input:

11 10

output:

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

result:

ok n = 11, k = 10: nice job dude

Test #8:

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

input:

11 11

output:

NO

result:

ok n = 11, k = 11: nice job dude

Test #9:

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

input:

53 1

output:

YES
53
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 5...

result:

ok n = 53, k = 1: nice job dude

Test #10:

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

input:

53 2

output:

YES
52
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 53

result:

ok n = 53, k = 2: nice job dude

Test #11:

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

input:

53 3

output:

YES
53
1 4
2 4
3 4
2 3
1 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
...

result:

ok n = 53, k = 3: nice job dude

Test #12:

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

input:

53 51

output:

YES
677
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8
1...

result:

ok n = 53, k = 51: nice job dude

Test #13:

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

input:

53 52

output:

YES
702
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8
1...

result:

ok n = 53, k = 52: nice job dude

Test #14:

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

input:

53 53

output:

NO

result:

ok n = 53, k = 53: nice job dude

Test #15:

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

input:

267 1

output:

YES
267
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 ...

result:

ok n = 267, k = 1: nice job dude

Test #16:

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

input:

267 2

output:

YES
266
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 ...

result:

ok n = 267, k = 2: nice job dude

Test #17:

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

input:

267 3

output:

YES
267
1 4
2 4
3 4
2 3
1 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52...

result:

ok n = 267, k = 3: nice job dude

Test #18:

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

input:

267 265

output:

YES
17690
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8...

result:

ok n = 267, k = 265: nice job dude

Test #19:

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

input:

267 266

output:

YES
17822
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8...

result:

ok n = 267, k = 266: nice job dude

Test #20:

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

input:

267 267

output:

NO

result:

ok n = 267, k = 267: nice job dude

Test #21:

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

input:

499 1

output:

YES
499
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 ...

result:

ok n = 499, k = 1: nice job dude

Test #22:

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

input:

499 2

output:

YES
498
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 ...

result:

ok n = 499, k = 2: nice job dude

Test #23:

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

input:

499 3

output:

YES
499
1 4
2 4
3 4
2 3
1 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52...

result:

ok n = 499, k = 3: nice job dude

Test #24:

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

input:

499 497

output:

YES
62002
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8...

result:

ok n = 499, k = 497: nice job dude

Test #25:

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

input:

499 498

output:

YES
62250
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8...

result:

ok n = 499, k = 498: nice job dude

Test #26:

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

input:

499 499

output:

NO

result:

ok n = 499, k = 499: nice job dude

Test #27:

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

input:

500 1

output:

YES
500
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 ...

result:

ok n = 500, k = 1: nice job dude

Test #28:

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

input:

500 2

output:

YES
499
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
52 ...

result:

ok n = 500, k = 2: nice job dude

Test #29:

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

input:

500 3

output:

YES
500
1 4
2 4
3 4
2 3
1 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52...

result:

ok n = 500, k = 3: nice job dude

Test #30:

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

input:

500 498

output:

YES
62251
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8...

result:

ok n = 500, k = 498: nice job dude

Test #31:

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

input:

500 499

output:

YES
62500
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8...

result:

ok n = 500, k = 499: nice job dude

Test #32:

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

input:

500 500

output:

NO

result:

ok n = 500, k = 500: nice job dude

Test #33:

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

input:

1 1

output:

YES
0

result:

ok n = 1, k = 1: nice job dude

Test #34:

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

input:

2 1

output:

YES
1
1 2

result:

ok n = 2, k = 1: nice job dude

Test #35:

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

input:

2 2

output:

NO

result:

ok n = 2, k = 2: nice job dude

Test #36:

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

input:

3 1

output:

YES
3
1 2
2 3
3 1

result:

ok n = 3, k = 1: nice job dude

Test #37:

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

input:

3 2

output:

YES
2
1 2
2 3

result:

ok n = 3, k = 2: nice job dude

Test #38:

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

input:

3 3

output:

NO

result:

ok n = 3, k = 3: nice job dude

Test #39:

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

input:

4 1

output:

YES
4
1 2
2 3
3 4
4 1

result:

ok n = 4, k = 1: nice job dude

Test #40:

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

input:

4 2

output:

YES
3
1 2
2 3
3 4

result:

ok n = 4, k = 2: nice job dude

Test #41:

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

input:

4 3

output:

YES
4
1 4
2 4
3 4
2 3

result:

ok n = 4, k = 3: nice job dude

Test #42:

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

input:

4 4

output:

NO

result:

ok n = 4, k = 4: nice job dude

Test #43:

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

input:

5 1

output:

YES
5
1 2
2 3
3 4
4 5
5 1

result:

ok n = 5, k = 1: nice job dude

Test #44:

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

input:

5 2

output:

YES
4
1 2
2 3
3 4
4 5

result:

ok n = 5, k = 2: nice job dude

Test #45:

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

input:

5 3

output:

YES
5
1 4
2 4
3 4
2 3
1 5

result:

ok n = 5, k = 3: nice job dude

Test #46:

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

input:

5 4

output:

YES
6
1 4
2 4
3 4
2 3
5 4
5 3

result:

ok n = 5, k = 4: nice job dude

Test #47:

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

input:

5 5

output:

NO

result:

ok n = 5, k = 5: nice job dude

Test #48:

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

input:

6 1

output:

YES
6
1 2
2 3
3 4
4 5
5 6
6 1

result:

ok n = 6, k = 1: nice job dude

Test #49:

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

input:

6 2

output:

YES
5
1 2
2 3
3 4
4 5
5 6

result:

ok n = 6, k = 2: nice job dude

Test #50:

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

input:

6 3

output:

YES
6
1 4
2 4
3 4
2 3
1 5
5 6

result:

ok n = 6, k = 3: nice job dude

Test #51:

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

input:

6 4

output:

YES
7
1 4
2 4
3 4
2 3
5 4
5 3
1 6

result:

ok n = 6, k = 4: nice job dude

Test #52:

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

input:

6 5

output:

YES
9
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5

result:

ok n = 6, k = 5: nice job dude

Test #53:

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

input:

6 6

output:

NO

result:

ok n = 6, k = 6: nice job dude

Test #54:

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

input:

103 85

output:

YES
1866
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8
...

result:

ok n = 103, k = 85: nice job dude

Test #55:

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

input:

373 203

output:

YES
10573
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8...

result:

ok n = 373, k = 203: nice job dude

Test #56:

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

input:

443 143

output:

YES
5483
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8
...

result:

ok n = 443, k = 143: nice job dude

Test #57:

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

input:

124 30

output:

YES
333
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8
1...

result:

ok n = 124, k = 30: nice job dude

Test #58:

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

input:

194 6

output:

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

result:

ok n = 194, k = 6: nice job dude

Test #59:

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

input:

464 369

output:

YES
34319
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8...

result:

ok n = 464, k = 369: nice job dude

Test #60:

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

input:

45 42

output:

YES
464
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8
1...

result:

ok n = 45, k = 42: nice job dude

Test #61:

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

input:

115 106

output:

YES
2870
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8
...

result:

ok n = 115, k = 106: nice job dude

Test #62:

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

input:

285 220

output:

YES
12274
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8...

result:

ok n = 285, k = 220: nice job dude

Test #63:

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

input:

143 106

output:

YES
2898
1 4
2 4
3 4
2 3
5 4
5 3
6 4
6 3
6 5
7 4
7 3
7 6
8 4
8 3
8 6
8 7
9 4
9 3
9 6
9 8
10 4
10 3
10 6
10 8
10 9
11 4
11 3
11 6
11 8
11 10
12 4
12 3
12 6
12 8
12 10
12 11
13 4
13 3
13 6
13 8
13 10
13 12
14 4
14 3
14 6
14 8
14 10
14 12
14 13
15 4
15 3
15 6
15 8
15 10
15 12
15 14
16 4
16 3
16 6
16 8
...

result:

ok n = 143, k = 106: nice job dude