QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#510659#5209. King's PuzzleGuanYunchangWA 4ms2116kbC++20847b2024-08-09 10:27:112024-08-09 10:27:12

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5 2

output:

YES
4
3 1
3 2
3 4
3 5

result:

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

Test #2:

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

input:

4 1

output:

YES
4
1 2
2 3
3 4
1 4

result:

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

Test #3:

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

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
1 11

result:

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

Test #4:

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

input:

11 2

output:

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

result:

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

Test #5:

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

input:

11 3

output:

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

result:

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

Test #6:

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

input:

11 9

output:

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

result:

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

Test #7:

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

input:

11 10

output:

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

result:

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

Test #8:

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

input:

11 11

output:

NO

result:

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

Test #9:

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

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: 1604kb

input:

53 2

output:

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

result:

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

Test #11:

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

input:

53 3

output:

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

result:

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

Test #12:

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

input:

53 51

output:

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

result:

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

Test #13:

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

input:

53 52

output:

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

result:

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

Test #14:

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

input:

53 53

output:

NO

result:

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

Test #15:

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

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: 1600kb

input:

267 2

output:

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

result:

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

Test #17:

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

input:

267 3

output:

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

result:

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

Test #18:

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

input:

267 265

output:

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

result:

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

Test #19:

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

input:

267 266

output:

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

result:

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

Test #20:

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

input:

267 267

output:

NO

result:

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

Test #21:

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

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: 1536kb

input:

499 2

output:

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

result:

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

Test #23:

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

input:

499 3

output:

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

result:

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

Test #24:

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

input:

499 497

output:

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

result:

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

Test #25:

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

input:

499 498

output:

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

result:

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

Test #26:

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

input:

499 499

output:

NO

result:

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

Test #27:

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

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: 1644kb

input:

500 2

output:

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

result:

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

Test #29:

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

input:

500 3

output:

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

result:

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

Test #30:

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

input:

500 498

output:

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

result:

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

Test #31:

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

input:

500 499

output:

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

result:

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

Test #32:

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

input:

500 500

output:

NO

result:

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

Test #33:

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

input:

1 1

output:

YES
0

result:

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

Test #34:

score: -100
Wrong Answer
time: 0ms
memory: 1628kb

input:

2 1

output:

YES
2
1 2
1 2

result:

wrong answer Integer parameter [name=m] equals to 2, violates the range [0, 1]