QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#591473#6398. Puzzle: Tapaucup-team2818#AC ✓2ms4020kbC++143.4kb2024-09-26 16:03:312024-09-26 16:03:38

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 3
2.4.3
.....
5.8.5
.....
3.5.3

output:

YES
2.4#3
#####
5#8#5
#####
3#5#3

result:

ok Correct.

Test #2:

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

input:

3 3
3.4.3
.....
5.7.5
.....
3.5.3

output:

NO

result:

ok Correct.

Test #3:

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

input:

2 2
2.2
...
2.2

output:

YES
2.2
###
2.2

result:

ok Correct.

Test #4:

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

input:

2 50
2.4.4.4.4.5.5.5.5.5.5.5.5.4.5.5.4.4.5.5.5.5.4.5.5.5.5.5.4.4.5.4.5.5.5.5.5.5.5.5.5.5.5.4.4.5.5.4.5.3
...................................................................................................
2.5.5.4.4.5.5.5.4.4.5.5.5.4.5.5.5.5.5.5.5.5.4.4.4.5.5.5.5.5.5.4.4.4.5.5.5.5.5.5.5.4.4.5.5.5.5.4...

output:

NO

result:

ok Correct.

Test #5:

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

input:

2 50
2.4.4.5.5.5.5.5.5.5.5.5.4.4.5.5.5.5.4.4.5.5.4.4.5.5.5.4.5.4.4.4.5.4.4.5.4.4.5.5.5.5.4.4.5.5.5.5.5.2
...................................................................................................
3.5.4.5.5.5.5.5.5.5.5.5.5.5.4.5.5.5.5.4.5.5.5.5.4.4.5.4.5.4.5.5.5.5.5.4.4.5.5.5.4.4.5.5.5.5.5.4...

output:

NO

result:

ok Correct.

Test #6:

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

input:

50 2
3.2
...
5.4
...
5.5
...
4.4
...
5.5
...
5.5
...
5.5
...
5.5
...
5.5
...
5.5
...
5.5
...
5.4
...
5.4
...
5.5
...
5.5
...
5.5
...
5.5
...
5.5
...
5.4
...
5.4
...
5.4
...
5.4
...
4.4
...
5.5
...
5.5
...
4.4
...
5.4
...
5.4
...
5.5
...
4.5
...
4.5
...
5.5
...
5.5
...
5.5
...
5.5
...
5.5
...
5.5
......

output:

NO

result:

ok Correct.

Test #7:

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

input:

50 2
3.3
...
5.4
...
5.4
...
5.4
...
5.4
...
5.5
...
4.4
...
4.4
...
5.5
...
4.4
...
5.5
...
5.5
...
5.5
...
5.5
...
4.5
...
5.5
...
5.5
...
5.4
...
5.4
...
5.5
...
5.4
...
5.5
...
5.4
...
5.4
...
5.5
...
5.5
...
4.5
...
4.5
...
4.5
...
4.5
...
5.5
...
5.4
...
5.4
...
5.5
...
5.5
...
4.4
...
4.4
......

output:

NO

result:

ok Correct.

Test #8:

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

input:

3 50
3.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.4.4.5.5.5.5.4.4.5.5.5.5.5.5.5.5.4.4.5.5.4.4.5.4.4.5.3
...................................................................................................
4.8.8.8.8.8.8.8.8.8.8.8.8.8.8.7.7.7.7.7.7.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.7.7.8...

output:

YES
3#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#4.4#5#5#5#5#4.4#5#5#5#5#5#5#5#5#4.4#5#5#4.4#5#4.4#5#3
###################################################################################################
4#8#8#8#8#8#8#8#8#8#8#8#8#8#8#7.7#7.7#7.7#8#8#8#8#8#8#8#8#8#8#8#8#8#8#8#8#8#8#8#8#8#8#8#8#7.7#8#...

result:

ok Correct.

Test #9:

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

input:

3 50
2.4.4.4.5.4.4.4.4.4.4.5.5.4.4.5.5.4.4.5.5.5.4.4.5.5.5.4.4.5.5.4.4.4.4.5.5.5.5.5.5.4.4.5.5.5.5.4.4.3
...................................................................................................
5.7.7.8.7.7.7.7.8.8.8.8.7.7.8.7.7.8.8.8.8.7.7.8.8.8.7.7.8.7.7.8.8.8.8.7.7.8.8.7.7.8.8.8.7.7.8.8...

output:

YES
2.4#4.4#5#4.4#4.4#4.4#5#5#4.4#5#5#4.4#5#5#5#4.4#5#5#5#4.4#5#5#4.4#4.4#5#5#5#5#5#5#4.4#5#5#5#5#4.4#3
###################################################################################################
5#7.7#8#7.7#7.7#8#8#8#8#7.7#8#7.7#8#8#8#8#7.7#8#8#8#7.7#8#7.7#8#8#8#8#7.7#8#8#7.7#8#8#8#7.7#8#8#...

result:

ok Correct.

Test #10:

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

input:

50 3
3.5.3
.....
5.8.5
.....
5.8.5
.....
5.8.5
.....
5.8.5
.....
5.8.5
.....
5.8.4
.....
5.8.4
.....
4.8.5
.....
4.7.5
.....
5.7.5
.....
5.8.5
.....
5.8.4
.....
5.8.4
.....
5.8.5
.....
5.8.5
.....
5.8.5
.....
5.8.5
.....
5.8.5
.....
4.8.5
.....
4.7.5
.....
5.7.5
.....
5.8.5
.....
5.8.5
.....
5.8.5
....

output:

YES
3#5#3
#####
5#8#5
#####
5#8#5
#####
5#8#5
#####
5#8#5
#####
5#8#5
#####
5#8#4
####.
5#8#4
#####
4#8#5
.####
4#7#5
##.##
5#7#5
#####
5#8#5
#####
5#8#4
####.
5#8#4
#####
5#8#5
#####
5#8#5
#####
5#8#5
#####
5#8#5
#####
5#8#5
#####
4#8#5
.####
4#7#5
##.##
5#7#5
#####
5#8#5
#####
5#8#5
#####
5#8#5
##...

result:

ok Correct.

Test #11:

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

input:

50 3
2.4.3
.....
4.8.5
.....
4.8.5
.....
5.8.5
.....
4.7.4
.....
4.7.4
.....
4.8.5
.....
4.8.4
.....
5.8.4
.....
4.7.5
.....
4.7.5
.....
5.8.5
.....
5.8.5
.....
5.8.4
.....
5.8.4
.....
5.8.5
.....
5.8.5
.....
5.7.5
.....
5.7.5
.....
5.8.5
.....
5.8.5
.....
5.8.5
.....
4.8.5
.....
4.7.5
.....
4.7.4
....

output:

YES
2.4#3
#####
4#8#5
.####
4#8#5
#####
5#8#5
#####
4#7#4
.#.#.
4#7#4
#####
4#8#5
.####
4#8#4
####.
5#8#4
#####
4#7#5
.#.##
4#7#5
#####
5#8#5
#####
5#8#5
#####
5#8#4
####.
5#8#4
#####
5#8#5
#####
5#8#5
#####
5#7#5
##.##
5#7#5
#####
5#8#5
#####
5#8#5
#####
5#8#5
#####
4#8#5
.####
4#7#5
##.##
4#7#4
.#...

result:

ok Correct.

Test #12:

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

input:

10 10
2.4.4.4.5.5.4.4.5.2
...................
5.7.8.8.7.8.7.7.8.4
...................
4.7.8.8.7.8.8.8.8.5
...................
4.8.8.8.7.7.8.8.8.4
...................
5.8.7.7.7.7.8.8.7.4
...................
4.7.7.8.8.8.8.8.7.4
...................
4.8.7.8.8.7.7.7.8.4
...................
5.8.7.8.8.7.8....

output:

YES
2.4#4.4#5#5#4.4#5#2
##################.
5#7#8#8#7#8#7.7#8#4
##.#####.##########
4#7#8#8#7#8#8#8#8#5
.##################
4#8#8#8#7.7#8#8#8#4
##################.
5#8#7.7#7.7#8#8#7#4
################.##
4#7.7#8#8#8#8#8#7#4
.#################.
4#8#7#8#8#7#7.7#8#4
####.#####.########
5#8#7#8#8#7#8#8#...

result:

ok Correct.

Test #13:

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

input:

10 10
3.5.5.5.5.5.5.4.4.3
...................
5.7.7.8.8.7.8.7.7.4
...................
5.8.8.7.7.7.7.7.8.4
...................
5.8.7.7.8.8.8.7.7.5
...................
5.8.8.7.7.7.7.7.7.5
...................
4.7.7.8.8.7.8.8.7.4
...................
4.7.7.7.7.7.7.8.7.4
...................
5.8.7.8.7.7.7....

output:

NO

result:

ok Correct.

Test #14:

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

input:

10 10
2.4.5.4.4.5.5.5.5.3
...................
4.8.7.7.8.8.8.7.8.4
...................
4.8.7.8.7.8.8.7.8.4
...................
5.7.7.8.7.7.7.8.7.5
...................
5.7.8.8.8.8.8.8.7.5
...................
4.7.8.7.7.7.8.8.8.5
...................
4.7.7.7.8.7.7.8.8.5
...................
4.7.8.7.8.8.7....

output:

YES
2.4#5#4.4#5#5#5#5#3
###################
4#8#7.7#8#8#8#7#8#4
.#############.###.
4#8#7#8#7#8#8#7#8#4
####.###.##########
5#7#7#8#7#7.7#8#7#5
##.#############.##
5#7#8#8#8#8#8#8#7#5
###################
4#7#8#7.7#7#8#8#8#5
.#.#######.########
4#7#7.7#8#7#7#8#8#5
############.######
4#7#8#7#8#8#7#8#...

result:

ok Correct.

Test #15:

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

input:

10 10
2.4.4.4.5.5.4.4.5.3
...................
5.7.8.8.7.7.7.7.7.5
...................
5.7.7.7.8.7.7.8.7.5
...................
4.8.7.7.8.8.8.7.8.4
...................
4.8.8.8.7.8.8.7.8.4
...................
4.8.8.8.7.8.8.8.8.5
...................
4.8.7.8.7.7.7.8.8.4
...................
5.8.7.8.7.8.8....

output:

YES
2.4#4.4#5#5#4.4#5#3
###################
5#7#8#8#7.7#7.7#7#5
##.#############.##
5#7#7.7#8#7.7#8#7#5
###################
4#8#7.7#8#8#8#7#8#4
.#############.###.
4#8#8#8#7#8#8#7#8#4
########.##########
4#8#8#8#7#8#8#8#8#5
.##################
4#8#7#8#7#7.7#8#8#4
####.###.#########.
5#8#7#8#7#8#8#8#...

result:

ok Correct.

Test #16:

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

input:

10 10
3.5.4.4.5.5.4.4.5.3
...................
5.7.8.8.7.8.8.8.8.5
...................
5.7.8.8.7.7.7.8.8.5
...................
5.8.7.7.8.8.7.8.8.5
...................
5.8.8.8.8.8.7.8.8.4
...................
5.7.7.8.8.7.8.7.8.4
...................
5.7.8.8.8.7.7.7.8.5
...................
5.7.8.8.8.8.7....

output:

YES
3#5#4.4#5#5#4.4#5#3
###################
5#7#8#8#7#8#8#8#8#5
##.#####.##########
5#7#8#8#7#7.7#8#8#5
###################
5#8#7.7#8#8#7#8#8#5
############.######
5#8#8#8#8#8#7#8#8#4
##################.
5#7.7#8#8#7#8#7#8#4
##########.###.####
5#7#8#8#8#7#7#7#8#5
##.#########.######
5#7#8#8#8#8#7#8#...

result:

ok Correct.

Test #17:

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

input:

10 10
3.5.5.4.4.5.5.4.4.3
...................
5.7.7.7.7.8.8.7.7.5
...................
5.8.7.7.8.8.8.8.8.5
...................
5.7.8.8.8.7.7.8.8.4
...................
5.7.7.7.8.7.7.8.7.4
...................
5.8.8.8.7.7.8.8.7.5
...................
4.7.7.8.8.8.7.7.8.5
...................
4.8.8.8.7.7.8....

output:

YES
3#5#5#4.4#5#5#4.4#3
###################
5#7.7#7.7#8#8#7.7#5
###################
5#8#7.7#8#8#8#8#8#5
###################
5#7#8#8#8#7.7#8#8#4
##.###############.
5#7#7.7#8#7.7#8#7#4
################.##
5#8#8#8#7.7#8#8#7#5
###################
4#7.7#8#8#8#7.7#8#5
.##################
4#8#8#8#7.7#8#7#...

result:

ok Correct.

Test #18:

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

input:

10 10
2.4.4.5.4.4.4.4.4.2
...................
4.8.7.8.8.7.8.8.8.4
...................
4.8.7.8.7.7.7.7.7.4
...................
4.7.7.8.7.8.7.7.7.4
...................
5.8.7.8.7.7.8.8.8.4
...................
4.8.7.8.7.7.7.7.7.5
...................
4.8.7.7.8.8.7.7.7.5
...................
4.7.7.8.8.7.8....

output:

YES
2#4.4#5#4.4#4.4#4.2
.##################
4#8#7#8#8#7#8#8#8#4
####.#####.#######.
4#8#7#8#7#7#7.7#7#4
.#######.#######.##
4#7.7#8#7#8#7.7#7#4
##################.
5#8#7#8#7.7#8#8#8#4
####.##############
4#8#7#8#7.7#7#7.7#5
.###########.######
4#8#7.7#8#8#7#7.7#5
###################
4#7.7#8#8#7#8#8#...

result:

ok Correct.

Test #19:

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

input:

10 10
2.4.4.4.4.4.4.4.4.2
...................
4.8.8.7.7.7.7.8.8.5
...................
4.7.8.7.8.8.7.8.7.4
...................
4.7.8.7.7.8.7.7.7.4
...................
4.8.7.8.7.7.7.7.8.4
...................
4.8.7.8.7.7.7.7.7.4
...................
4.7.8.7.8.7.7.7.7.4
...................
4.7.7.7.7.7.7....

output:

YES
2.4#4.4#4.4#4.4#4.2
###################
4#8#8#7.7#7.7#8#8#5
.##################
4#7#8#7#8#8#7#8#7#4
##.###.#####.###.#.
4#7#8#7#7#8#7#7#7#4
.#######.#####.####
4#8#7#8#7#7.7#7#8#4
####.#############.
4#8#7#8#7.7#7#7.7#4
.###########.######
4#7#8#7#8#7#7#7.7#4
##.###.###.#######.
4#7#7#7#7#7#7.7#...

result:

ok Correct.

Test #20:

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

input:

50 50
3.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.4.4.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.3
...................................................................................................
5.8.8.8.8.7.7.8.8.8.8.8.7.7.8.8.8.7.7.7.8.8.8.8.8.8.8.8.8.8.8.7.8.8.8.7.7.8.8.8.8.8.8.8.8.7.8....

output:

YES
3#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#4.4#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#5#3
###################################################################################################
5#8#8#8#8#7.7#8#8#8#8#8#7.7#8#8#8#7#7.7#8#8#8#8#8#8#8#8#8#8#8#7#8#8#8#7.7#8#8#8#8#8#8#8#8#7#8#7....

result:

ok Correct.

Test #21:

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

input:

50 50
3.5.5.5.4.4.5.5.5.5.5.5.5.5.5.5.5.5.4.4.5.4.4.4.4.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.5.3
...................................................................................................
4.8.8.8.8.8.8.7.7.8.8.8.8.8.8.8.8.8.7.7.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8.8....

output:

NO

result:

ok Correct.

Test #22:

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

input:

50 50
3.5.4.4.5.5.5.5.4.4.5.4.4.5.5.4.4.5.5.5.5.5.5.4.4.5.5.5.5.5.5.4.4.5.5.4.4.5.5.5.5.5.5.5.5.5.5.5.5.3
...................................................................................................
5.7.7.8.8.8.7.7.7.8.8.8.8.8.7.8.8.8.8.8.8.8.8.8.8.7.7.8.8.7.7.8.8.8.8.8.8.8.8.8.7.7.8.8.8.8.7....

output:

YES
3#5#4.4#5#5#5#5#4.4#5#4.4#5#5#4.4#5#5#5#5#5#5#4.4#5#5#5#5#5#5#4.4#5#5#4.4#5#5#5#5#5#5#5#5#5#5#5#5#3
###################################################################################################
5#7.7#8#8#8#7#7.7#8#8#8#8#8#7#8#8#8#8#8#8#8#8#8#8#7.7#8#8#7.7#8#8#8#8#8#8#8#8#8#7.7#8#8#8#8#7#8#...

result:

ok Correct.

Test #23:

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

input:

50 50
3.5.4.4.5.4.4.5.5.5.5.5.5.5.5.5.5.4.4.5.5.4.4.4.4.5.5.4.4.5.4.4.5.5.5.4.5.5.5.4.4.5.5.4.4.5.5.5.4.2
...................................................................................................
4.7.8.8.8.7.7.8.7.7.8.8.7.8.8.8.8.7.7.8.8.8.8.8.7.8.8.8.8.8.8.8.8.8.8.8.8.8.7.8.8.8.8.8.7.8.8....

output:

NO

result:

ok Correct.

Test #24:

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

input:

50 50
2.4.5.4.4.5.4.4.5.5.5.4.4.4.4.5.5.5.5.4.4.5.5.5.4.4.5.4.4.5.4.4.5.4.4.5.4.4.5.4.4.5.4.4.5.5.5.5.5.3
...................................................................................................
5.8.8.8.8.7.8.8.8.8.8.8.8.8.7.7.8.8.8.8.8.8.7.7.7.8.8.8.8.7.7.8.8.8.7.8.8.8.7.7.8.8.8.8.7.7.8....

output:

YES
2.4#5#4.4#5#4.4#5#5#5#4.4#4.4#5#5#5#5#4.4#5#5#5#4.4#5#4.4#5#4.4#5#4.4#5#4.4#5#4.4#5#4.4#5#5#5#5#5#3
###################################################################################################
5#8#8#8#8#7#8#8#8#8#8#8#8#8#7.7#8#8#8#8#8#8#7#7.7#8#8#8#8#7.7#8#8#8#7#8#8#8#7.7#8#8#8#8#7.7#8#7....

result:

ok Correct.

Test #25:

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

input:

50 50
2.5.5.5.5.5.5.5.5.5.5.5.4.4.4.4.5.4.4.4.4.4.4.5.5.5.4.4.5.5.4.4.5.5.5.5.5.5.5.5.5.4.4.5.5.5.5.5.5.3
...................................................................................................
4.7.7.7.7.7.8.8.8.8.7.7.8.8.8.8.7.7.8.7.7.8.8.8.7.7.8.7.8.8.8.7.7.8.8.7.7.7.7.7.8.8.7.7.8.8.8....

output:

NO

result:

ok Correct.

Test #26:

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

input:

50 50
2.4.4.5.5.5.5.5.5.5.5.5.4.4.5.5.5.4.4.5.5.5.5.5.5.5.5.4.4.5.4.4.5.5.5.5.5.5.4.4.5.4.4.4.4.4.4.5.5.3
...................................................................................................
4.8.7.7.7.7.7.8.7.7.7.7.8.7.7.7.8.7.8.7.7.7.7.8.8.8.8.8.8.8.8.7.7.8.7.8.8.8.8.8.8.8.7.8.8.8.8....

output:

NO

result:

ok Correct.

Test #27:

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

input:

50 50
3.5.4.4.4.4.5.4.4.5.4.4.5.5.5.5.5.5.4.4.5.4.4.5.5.5.4.4.5.5.5.4.4.5.5.5.5.5.5.4.4.4.4.4.4.5.5.4.4.3
...................................................................................................
5.8.7.8.8.8.7.7.8.7.7.8.8.8.7.7.8.7.8.8.8.8.7.8.8.8.8.7.7.8.8.7.7.8.7.7.7.7.7.7.8.8.7.7.8.7.7....

output:

NO

result:

ok Correct.

Test #28:

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

input:

50 50
3.5.4.4.5.4.4.5.5.5.4.4.5.5.4.4.4.4.4.4.5.5.5.5.4.4.5.5.5.5.4.4.5.5.5.5.4.4.5.4.4.5.5.4.4.5.4.4.5.3
...................................................................................................
4.8.8.8.7.8.7.7.7.7.8.8.8.7.7.8.8.8.7.8.8.8.8.8.8.8.7.7.8.7.8.8.7.7.8.7.7.7.7.8.8.7.8.7.7.7.7....

output:

YES
3#5#4.4#5#4.4#5#5#5#4.4#5#5#4.4#4.4#4.4#5#5#5#5#4.4#5#5#5#5#4.4#5#5#5#5#4.4#5#4.4#5#5#4.4#5#4.4#5#3
###################################################################################################
4#8#8#8#7#8#7.7#7.7#8#8#8#7.7#8#8#8#7#8#8#8#8#8#8#8#7.7#8#7#8#8#7.7#8#7#7#7.7#8#8#7#8#7.7#7.7#7....

result:

ok Correct.

Test #29:

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

input:

50 50
3.5.4.4.4.4.5.5.4.4.4.4.5.4.4.4.4.4.5.4.4.4.4.5.5.4.4.5.5.5.5.4.4.5.5.5.5.5.4.4.5.4.4.4.4.5.5.5.5.3
...................................................................................................
4.8.8.7.7.8.8.8.8.8.8.8.7.7.7.8.8.8.8.7.7.8.8.7.7.7.7.7.7.7.7.8.8.7.7.7.7.7.7.7.7.7.8.7.7.7.8....

output:

NO

result:

ok Correct.

Test #30:

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

input:

50 50
2.4.4.5.5.4.4.5.4.4.4.4.5.4.4.4.4.5.5.4.4.5.5.5.5.5.5.4.4.5.4.4.4.4.5.4.4.4.4.4.4.5.4.4.5.5.4.4.5.2
...................................................................................................
4.7.7.7.8.8.8.7.7.7.8.8.8.8.8.8.8.7.7.8.8.8.7.7.7.8.8.7.7.7.7.7.7.7.8.7.7.8.8.8.7.7.8.8.8.7.8....

output:

YES
2#4.4#5#5#4.4#5#4.4#4.4#5#4.4#4.4#5#5#4.4#5#5#5#5#5#5#4.4#5#4.4#4.4#5#4.4#4.4#4.4#5#4.4#5#5#4.4#5#2
.#################################################################################################.
4#7.7#7#8#8#8#7.7#7#8#8#8#8#8#8#8#7.7#8#8#8#7#7.7#8#8#7#7.7#7.7#7.7#8#7.7#8#8#8#7.7#8#8#8#7#8#7....

result:

ok Correct.

Test #31:

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

input:

50 50
3.4.4.5.5.5.5.5.4.4.5.4.4.5.4.4.5.4.4.5.5.5.4.4.4.4.5.4.4.4.4.5.4.4.5.5.4.4.5.4.4.5.5.4.4.5.5.4.4.3
...................................................................................................
5.7.8.7.7.8.7.7.8.7.7.8.7.7.8.7.7.8.7.8.7.8.7.7.7.7.7.7.8.8.8.8.8.7.8.8.8.8.7.7.7.7.8.8.8.7.7....

output:

YES
3#4.4#5#5#5#5#5#4.4#5#4.4#5#4.4#5#4.4#5#5#5#4.4#4.4#5#4.4#4.4#5#4.4#5#5#4.4#5#4.4#5#5#4.4#5#5#4.4#3
###################################################################################################
5#7#8#7.7#8#7.7#8#7.7#8#7.7#8#7.7#8#7#8#7#8#7.7#7#7#7.7#8#8#8#8#8#7#8#8#8#8#7.7#7.7#8#8#8#7.7#8#...

result:

ok Correct.

Test #32:

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

input:

50 50
3.4.4.5.4.4.5.4.4.5.5.5.5.4.4.4.4.5.4.4.5.5.4.4.5.5.4.4.5.5.4.4.4.4.4.4.4.4.5.5.4.4.5.5.5.5.4.4.4.2
...................................................................................................
5.7.7.8.7.7.8.7.7.7.8.7.7.8.8.8.8.8.7.7.7.7.7.7.7.7.7.7.7.7.8.7.8.8.8.8.8.7.7.8.8.7.7.8.8.8.8....

output:

YES
3#4.4#5#4.4#5#4.4#5#5#5#5#4.4#4.4#5#4.4#5#5#4.4#5#5#4.4#5#5#4.4#4.4#4.4#4.4#5#5#4.4#5#5#5#5#4.4#4.2
###################################################################################################
5#7.7#8#7.7#8#7.7#7#8#7.7#8#8#8#8#8#7#7.7#7.7#7#7#7.7#7.7#7#8#7#8#8#8#8#8#7.7#8#8#7.7#8#8#8#8#8#...

result:

ok Correct.

Test #33:

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

input:

50 50
2.4.4.4.4.4.4.5.4.4.4.4.5.4.4.4.4.5.4.4.4.4.5.5.5.4.4.5.4.4.5.4.4.4.4.5.5.4.4.4.4.5.5.5.5.5.4.4.5.3
...................................................................................................
4.8.7.7.8.7.7.7.7.7.8.7.7.7.7.7.8.7.8.7.8.7.7.8.7.8.8.7.7.7.8.8.7.8.7.7.7.7.7.7.7.8.8.7.8.8.8....

output:

YES
2#4.4#4.4#4.4#5#4.4#4.4#5#4.4#4.4#5#4.4#4.4#5#5#5#4.4#5#4.4#5#4.4#4.4#5#5#4.4#4.4#5#5#5#5#5#4.4#5#3
.##################################################################################################
4#8#7#7#8#7.7#7#7#7#8#7.7#7.7#7#8#7#8#7#8#7.7#8#7#8#8#7#7.7#8#8#7#8#7#7.7#7.7#7.7#8#8#7#8#8#8#8#...

result:

ok Correct.

Test #34:

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

input:

50 50
2.4.5.5.4.4.4.4.4.4.5.4.4.5.4.4.5.4.4.5.5.4.4.5.5.4.4.4.4.4.4.5.5.5.5.5.4.4.4.4.5.5.5.4.4.5.5.4.4.3
...................................................................................................
5.8.8.7.7.7.8.7.7.8.8.7.7.8.7.7.7.7.7.7.7.7.8.7.8.7.7.7.7.7.7.8.8.7.7.8.8.7.7.7.7.8.8.8.8.8.8....

output:

YES
2.4#5#5#4.4#4.4#4.4#5#4.4#5#4.4#5#4.4#5#5#4.4#5#5#4.4#4.4#4.4#5#5#5#5#5#4.4#4.4#5#5#5#4.4#5#5#4.4#3
###################################################################################################
5#8#8#7#7#7#8#7.7#8#8#7.7#8#7.7#7#7.7#7#7.7#8#7#8#7#7.7#7#7.7#8#8#7.7#8#8#7.7#7.7#8#8#8#8#8#8#7....

result:

ok Correct.

Test #35:

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

input:

50 50
3.5.5.4.4.4.4.5.4.4.4.4.4.4.4.4.5.4.4.5.4.4.5.4.4.5.4.4.4.4.5.5.4.4.4.4.4.4.5.5.5.5.4.4.5.4.4.4.4.2
...................................................................................................
5.7.8.7.7.7.8.8.8.8.8.7.8.7.7.7.7.8.8.8.7.7.7.7.7.8.7.7.7.7.7.7.7.7.7.8.7.8.7.7.7.7.7.7.7.7.7....

output:

YES
3#5#5#4.4#4.4#5#4.4#4.4#4.4#4.4#5#4.4#5#4.4#5#4.4#5#4.4#4.4#5#5#4.4#4.4#4.4#5#5#5#5#4.4#5#4.4#4.4#2
##################################################################################################.
5#7#8#7.7#7#8#8#8#8#8#7#8#7.7#7.7#8#8#8#7.7#7#7.7#8#7#7.7#7.7#7.7#7.7#8#7#8#7.7#7#7.7#7#7.7#7.7#...

result:

ok Correct.

Test #36:

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

input:

50 50
3.4.4.4.4.5.4.4.5.4.4.4.4.5.4.4.4.4.4.4.4.4.4.4.4.4.5.5.4.4.4.4.4.4.5.4.4.4.4.5.4.4.4.4.5.4.4.4.4.3
...................................................................................................
5.7.7.7.7.8.7.7.7.7.7.7.7.7.8.8.8.8.7.7.7.8.7.7.8.8.7.7.7.8.7.7.7.8.7.7.7.7.7.7.8.8.8.7.7.8.7....

output:

NO

result:

ok Correct.

Test #37:

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

input:

50 50
2.4.4.4.5.5.4.4.4.4.5.5.4.4.5.5.4.4.4.4.4.4.5.5.5.4.4.5.5.5.5.4.4.4.4.4.4.4.4.4.4.4.4.5.5.5.5.4.4.2
...................................................................................................
5.7.7.7.7.7.7.8.7.7.7.7.7.7.8.7.8.7.7.7.7.7.8.8.8.7.7.8.7.8.8.7.8.7.7.7.8.8.8.7.7.8.8.7.7.8.7....

output:

NO

result:

ok Correct.

Test #38:

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

input:

50 50
3.4.4.5.5.4.4.5.5.4.4.5.4.4.4.4.4.4.5.5.4.4.4.4.4.4.5.4.4.5.5.4.4.4.4.4.4.4.4.5.5.5.5.4.4.4.4.4.4.3
...................................................................................................
4.8.7.7.7.7.7.8.8.7.8.7.7.8.8.8.7.7.7.7.8.7.8.7.7.7.7.7.8.7.7.7.7.8.8.8.7.7.8.8.7.8.8.7.7.7.7....

output:

YES
3#4.4#5#5#4.4#5#5#4.4#5#4.4#4.4#4.4#5#5#4.4#4.4#4.4#5#4.4#5#5#4.4#4.4#4.4#4.4#5#5#5#5#4.4#4.4#4.4#3
###################################################################################################
4#8#7#7#7.7#7#8#8#7#8#7#7#8#8#8#7#7.7#7#8#7#8#7.7#7#7.7#8#7.7#7.7#8#8#8#7.7#8#8#7#8#8#7#7.7#7.7#...

result:

ok Correct.

Test #39:

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

input:

50 50
2.4.4.4.4.5.5.4.4.5.5.4.4.4.4.4.4.5.5.4.4.5.4.4.4.4.4.4.4.4.4.4.5.4.4.5.5.5.4.4.4.4.4.4.4.4.5.5.5.2
...................................................................................................
4.8.7.7.8.8.8.7.7.8.7.7.7.7.7.8.7.8.7.7.7.8.7.8.7.8.8.7.7.7.8.7.7.8.7.7.7.7.7.8.7.7.7.8.7.7.8....

output:

YES
2#4.4#4.4#5#5#4.4#5#5#4.4#4.4#4.4#5#5#4.4#5#4.4#4.4#4.4#4.4#4.4#5#4.4#5#5#5#4.4#4.4#4.4#4.4#5#5#5#2
.#################################################################################################.
4#8#7.7#8#8#8#7.7#8#7.7#7.7#7#8#7#8#7.7#7#8#7#8#7#8#8#7.7#7#8#7.7#8#7#7#7#7.7#8#7#7.7#8#7#7#8#7....

result:

ok Correct.

Test #40:

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

input:

50 50
2.5.4.4.4.4.4.4.4.4.4.4.4.4.5.5.4.4.5.5.4.4.4.4.5.4.4.4.4.4.4.5.4.4.4.4.4.4.4.4.4.4.4.4.4.4.5.4.4.2
...................................................................................................
4.7.7.7.7.7.7.7.7.7.8.8.7.8.7.7.7.7.7.8.8.7.7.8.7.8.8.7.7.7.7.7.7.7.7.7.7.7.7.7.8.7.7.8.7.7.8....

output:

YES
2#5#4.4#4.4#4.4#4.4#4.4#4.4#5#5#4.4#5#5#4.4#4.4#5#4.4#4.4#4.4#5#4.4#4.4#4.4#4.4#4.4#4.4#4.4#5#4.4#2
.#################################################################################################.
4#7#7.7#7#7.7#7.7#7#8#8#7#8#7#7.7#7.7#8#8#7.7#8#7#8#8#7#7.7#7#7.7#7.7#7.7#7.7#7#8#7.7#8#7.7#8#7....

result:

ok Correct.

Test #41:

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

input:

50 50
2.4.4.4.4.4.4.4.5.4.4.5.4.4.5.4.4.5.5.4.4.4.4.5.4.4.5.4.4.5.4.4.4.4.5.4.4.4.4.4.4.4.4.4.4.5.4.4.5.3
...................................................................................................
5.7.7.7.7.7.7.7.8.7.7.7.8.7.7.7.8.7.7.8.8.7.8.8.7.7.8.8.7.7.7.8.7.7.7.7.7.7.8.7.7.7.7.7.8.7.7....

output:

YES
2.4#4.4#4.4#4.4#5#4.4#5#4.4#5#4.4#5#5#4.4#4.4#5#4.4#5#4.4#5#4.4#4.4#5#4.4#4.4#4.4#4.4#4.4#5#4.4#5#3
###################################################################################################
5#7.7#7#7#7.7#7#8#7#7.7#8#7.7#7#8#7.7#8#8#7#8#8#7.7#8#8#7.7#7#8#7.7#7#7.7#7#8#7#7.7#7.7#8#7.7#8#...

result:

ok Correct.

Test #42:

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

input:

50 50
2.4.4.4.4.4.5.4.4.4.4.5.4.4.4.4.4.4.4.4.4.4.5.4.4.4.4.5.4.4.5.5.4.4.5.4.4.5.4.4.4.4.5.4.4.4.4.4.4.3
...................................................................................................
4.7.7.7.7.7.7.7.8.7.7.7.7.7.7.7.7.7.8.7.7.8.8.7.8.7.7.8.7.7.8.7.8.7.7.7.7.8.7.7.8.7.7.8.7.8.7....

output:

YES
2.4#4.4#4.4#5#4.4#4.4#5#4.4#4.4#4.4#4.4#4.4#5#4.4#4.4#5#4.4#5#5#4.4#5#4.4#5#4.4#4.4#5#4.4#4.4#4.4#3
###################################################################################################
4#7#7#7.7#7.7#7#8#7.7#7.7#7.7#7.7#7#8#7.7#8#8#7#8#7.7#8#7#7#8#7#8#7.7#7.7#8#7.7#8#7.7#8#7#8#7.7#...

result:

ok Correct.

Test #43:

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

input:

50 50
2.4.4.4.5.4.4.4.4.4.4.5.4.4.5.4.4.4.4.4.4.5.4.4.4.4.5.4.4.4.4.5.4.4.4.4.4.4.4.4.4.4.5.4.4.5.4.4.4.2
...................................................................................................
5.8.7.7.8.8.7.7.8.7.7.8.8.7.7.7.7.7.7.7.7.7.8.7.7.7.7.7.7.7.7.7.7.7.8.7.7.7.7.7.8.7.7.7.7.7.8....

output:

NO

result:

ok Correct.

Test #44:

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

input:

37 48
2.4.5.5.4.4.5.5.5.4.4.4.4.4.4.5.4.4.5.5.5.4.4.4.4.5.5.5.4.4.5.5.4.4.5.5.5.5.5.4.4.5.5.5.5.4.4.3
...............................................................................................
5.7.7.7.7.8.8.8.7.7.8.8.8.7.7.7.8.8.7.7.8.7.8.7.8.8.8.8.8.7.8.7.7.8.8.8.7.7.7.8.8.8.7.7.8.8.7.4
.........

output:

YES
2.4#5#5#4.4#5#5#5#4.4#4.4#4.4#5#4.4#5#5#5#4.4#4.4#5#5#5#4.4#5#5#4.4#5#5#5#5#5#4.4#5#5#5#5#4.4#3
###############################################################################################
5#7#7.7#7#8#8#8#7.7#8#8#8#7#7.7#8#8#7.7#8#7#8#7#8#8#8#8#8#7#8#7.7#8#8#8#7#7.7#8#8#8#7.7#8#8#7#4
##.#####...

result:

ok Correct.

Test #45:

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

input:

14 49
3.5.4.4.5.5.5.4.4.5.4.4.5.4.4.5.5.4.4.5.5.5.4.4.4.4.5.4.4.4.4.4.4.5.5.5.4.4.4.4.4.4.5.5.5.5.5.4.2
.................................................................................................
4.8.7.7.7.7.7.7.7.7.8.7.7.8.8.7.7.8.7.7.8.7.8.7.8.7.7.7.7.8.7.8.7.7.7.8.7.7.7.7.8.8.7.7.7.7.8.7.5
...

output:

YES
3#5#4.4#5#5#5#4.4#5#4.4#5#4.4#5#5#4.4#5#5#5#4.4#4.4#5#4.4#4.4#4.4#5#5#5#4.4#4.4#4.4#5#5#5#5#5#4.2
#################################################################################################
4#8#7.7#7#7.7#7.7#7#8#7.7#8#8#7.7#8#7.7#8#7#8#7#8#7.7#7.7#8#7#8#7#7.7#8#7.7#7.7#8#8#7.7#7#7#8#7#5
.#...

result:

ok Correct.

Test #46:

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

input:

33 27
2.4.5.4.4.4.4.4.4.5.5.4.4.4.4.4.4.5.4.4.5.5.4.4.4.4.3
.....................................................
5.7.7.7.8.7.7.8.8.8.7.7.8.7.7.7.7.8.7.7.8.7.7.7.7.8.4
.....................................................
4.7.7.7.8.7.7.7.7.8.8.7.7.8.8.8.7.7.8.7.7.8.8.8.8.7.4
...........................

output:

YES
2.4#5#4.4#4.4#4.4#5#5#4.4#4.4#4.4#5#4.4#5#5#4.4#4.4#3
#####################################################
5#7#7.7#8#7.7#8#8#8#7.7#8#7.7#7.7#8#7.7#8#7.7#7.7#8#4
##.#################################################.
4#7#7.7#8#7.7#7.7#8#8#7.7#8#8#8#7.7#8#7.7#8#8#8#8#7#4
.#########################...

result:

ok Correct.

Test #47:

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

input:

13 26
2.4.5.4.4.4.4.5.4.4.5.5.4.4.5.4.4.5.4.4.5.4.4.4.4.2
...................................................
5.7.7.7.7.8.7.7.7.7.7.7.7.7.7.7.7.7.8.7.7.7.7.7.7.4
...................................................
4.7.7.7.7.7.7.8.7.7.8.8.7.7.7.7.8.7.8.8.8.7.8.7.7.4
.....................................

output:

YES
2.4#5#4.4#4.4#5#4.4#5#5#4.4#5#4.4#5#4.4#5#4.4#4.4#2
##################################################.
5#7.7#7.7#8#7.7#7.7#7.7#7#7.7#7#7.7#8#7.7#7.7#7#7#4
########################.#####.###############.#.##
4#7#7.7#7.7#7#8#7.7#8#8#7#7.7#7#8#7#8#8#8#7#8#7#7#4
.#.#########.#####################.#...

result:

ok Correct.

Test #48:

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

input:

45 7
2.4.5.4.4.5.2
.............
4.7.7.7.7.7.4
.............
4.7.7.7.7.7.5
.............
4.8.8.7.7.7.5
.............
4.7.7.7.7.8.4
.............
4.7.8.7.7.7.4
.............
4.7.8.7.8.7.5
.............
4.7.7.7.7.7.4
.............
4.8.8.7.8.8.4
.............
5.7.7.8.7.7.4
.............
4.7.7.7.7.7.4
....

output:

YES
2.4#5#4.4#5#2
############.
4#7.7#7#7.7#4
.#####.######
4#7.7#7#7#7#5
########.#.##
4#8#8#7#7#7#5
.#####.######
4#7.7#7#7#8#4
########.###.
4#7#8#7#7#7#4
.#.###.###.##
4#7#8#7#8#7#5
#############
4#7.7#7#7.7#4
.#####.#####.
4#8#8#7#8#8#4
#############
5#7#7#8#7.7#4
##.#.#######.
4#7#7#7.7#7#4
.#...

result:

ok Correct.

Test #49:

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

input:

48 36
2.5.5.4.4.4.4.5.4.4.5.5.4.4.5.5.5.5.4.4.4.4.5.5.5.5.5.4.4.4.4.5.5.5.5.3
.......................................................................
4.8.8.7.7.7.8.8.8.8.8.8.7.7.8.8.7.7.7.7.7.8.8.8.8.8.7.7.7.7.7.8.7.8.8.4
.......................................................................
4.8.8....

output:

YES
2#5#5#4.4#4.4#5#4.4#5#5#4.4#5#5#5#5#4.4#4.4#5#5#5#5#5#4.4#4.4#5#5#5#5#3
.######################################################################
4#8#8#7.7#7#8#8#8#8#8#8#7.7#8#8#7.7#7.7#7#8#8#8#8#8#7.7#7#7.7#8#7#8#8#4
##########.#############################.###############.#######.#####.
4#8#8#7#...

result:

ok Correct.

Test #50:

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

input:

2 2
3.3
...
3.3

output:

YES
3#3
###
3#3

result:

ok Correct.

Test #51:

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

input:

2 2
2.3
...
2.3

output:

YES
2#3
.##
2#3

result:

ok Correct.

Test #52:

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

input:

2 5
2.4.4.5.2
.........
2.5.4.4.2

output:

YES
2#4.4#5#2
.#######.
2#5#4.4#2

result:

ok Correct.

Test #53:

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

input:

5 2
2.2
...
4.4
...
5.5
...
5.4
...
3.2

output:

YES
2#2
.#.
4#4
###
5#5
###
5#4
##.
3#2

result:

ok Correct.

Test #54:

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

input:

5 2
2.2
...
4.5
...
4.5
...
5.4
...
3.2

output:

YES
2.2
###
4#5
.##
4#5
###
5#4
##.
3#2

result:

ok Correct.