QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#241735#6398. Puzzle: Tapaucup-team902#AC ✓1ms4112kbC++143.0kb2023-11-06 16:29:392023-11-06 16:29:40

Judging History

你现在查看的是最新测评结果

  • [2023-11-06 16:29:40]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:4112kb
  • [2023-11-06 16:29:39]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define cs const
#define re register
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define y1 shinkle
#define fi first
#define se second
#define bg begin
namespace IO{
#define gc getchar
inline int read(){
    char ch=gc();
    int res=0;bool f=1;
    while(!isdigit(ch))f^=ch=='-',ch=gc();
    while(isdigit(ch))res=(res*10)+(ch^48),ch=gc();
    return f?res:-res;
}
inline ll readll(){
    char ch=gc();
    ll res=0;bool f=1;
    while(!isdigit(ch))f^=ch=='-',ch=gc();
    while(isdigit(ch))res=(res*10)+(ch^48),ch=gc();
    return f?res:-res;
}
inline char readchar(){
	char ch=gc();
	while(isspace(ch))ch=gc();
	return ch;
}
inline int readstring(char *s){
	int top=0;char ch=gc();
	while(isspace(ch))ch=gc();
	while(!isspace(ch)&&ch!=EOF)s[++top]=ch,ch=gc();
	s[top+1]='\0';return top;
}

}
using IO::read;
using IO::readll;
using IO::readchar;
using IO::readstring;
template<typename tp>inline void chemx(tp &a,tp b){(a<b)?(a=b):0;}
template<typename tp>inline void chemn(tp &a,tp b){(a>b)?(a=b):0;}

cs int N=105,M=N*N;
char s[N][N];
int a[M];
int n,m,cnt;
int id[N][N];
pii p[M];
vector<int> e[M];
int vis[M],mat[M],col[M];
void add(int u,int v){
	if(a[u]==1||a[v]==1)return;
	if(col[u]==1)e[u].pb(v);
	else e[v].pb(u);
}
bool dfs(int u){
	if(vis[u])return false;
	vis[u]=1;
	for(int v:e[u]){
		if(!mat[v]||dfs(mat[v])){
			mat[v]=u;return true;
		}
	}
	return false;
}
int main(){
	n=read(),m=read();
	int c1=0;
	for(int i=1;i<=2*n-1;i++){
		readstring(s[i]);
		
		if(i&1){
			c1^=1;
			for(int j=2;j<=2*m-1;j+=2)s[i][j]='#';
			int c2=0;
			for(int j=1;j<=2*m-1;j+=2){
				//a[(i+1)/2][(j+1)/2]=s[i]-'0';
				id[(i+1)/2][(j+1)/2]=++cnt;
				a[cnt]=s[i][j]-'0';
				col[cnt]=c1^c2;
				c2^=1;
				if(a[cnt]<=3)a[cnt]-=2;
				else if(a[cnt]<=5)a[cnt]-=4;
				else if(a[cnt]<=8)a[cnt]-=7;
				p[cnt]=pii(i,j);
			}
		}
		else{
			for(int j=1;j<=2*m-1;j++)s[i][j]='#';
		}
	}
	// puts("");
	// for(int i=1;i<=2*n-1;i++){
	// 	cout<<(s[i]+1)<<'\n';
	// }puts("");
	for(int i=1;i<m;i++){
		add(id[1][i],id[1][i+1]);
		add(id[n][i],id[n][i+1]);
	}
	for(int i=1;i<n;i++){
		add(id[i][1],id[i+1][1]);
		add(id[i][m],id[i+1][m]);
	}
	for(int i=2;i<n;i++)
	for(int j=2;j+1<m;j++){
		add(id[i][j],id[i][j+1]);
	}
	for(int i=2;i+1<n;i++)
	for(int j=2;j<m;j++){
		add(id[i][j],id[i+1][j]);
	}
	for(int i=1;i<=cnt;i++)if(a[i]==0&&col[i]==1){
		memset(vis,0,sizeof(vis));
		if(!(dfs(i))){
			puts("NO");exit(0);
		}
	}
	for(int i=1;i<=cnt;i++)if(a[i]==0&&col[i]==0){
		if(!mat[i]){
			puts("NO");exit(0);
		}
		int px=p[i].fi+p[mat[i]].fi;
		int py=p[i].se+p[mat[i]].se;
		assert(px%2==0&&py%2==0);
		s[px/2][py/2]='.';
	}
	// for(int i=1;i<=2*n-1;i+=2)
	// for(int j=1;j<=2*m-1;j+=2){
	// 	int ct=0;
	// 	for(int t=-1;t<=1;t++)
	// 	for(int r=-1;r<=1;r++)if(t!=0||r!=0){
	// 		ct+=(s[i+t][j+r]=='#');
	// 	}
	// 	assert(ct==s[i][j]-'0');
	// }
	puts("YES");
	for(int i=1;i<=2*n-1;i++){
		cout<<(s[i]+1)<<'\n';
	}
}

詳細信息

Test #1:

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

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

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

input:

2 2
2.2
...
2.2

output:

YES
2.2
###
2.2

result:

ok Correct.

Test #4:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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: 0ms
memory: 3988kb

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: 0ms
memory: 4008kb

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

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

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

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

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: 0ms
memory: 4036kb

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

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

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

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

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: 1ms
memory: 4020kb

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

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: 1ms
memory: 4024kb

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

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: 1ms
memory: 4052kb

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: 0ms
memory: 4088kb

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: 1ms
memory: 3988kb

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: 1ms
memory: 4088kb

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: 1ms
memory: 4060kb

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: 1ms
memory: 4088kb

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: 1ms
memory: 4028kb

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: 1ms
memory: 4016kb

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

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

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

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

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: 0ms
memory: 4024kb

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

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

input:

2 2
3.3
...
3.3

output:

YES
3#3
###
3#3

result:

ok Correct.

Test #51:

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

input:

2 2
2.3
...
2.3

output:

YES
2#3
.##
2#3

result:

ok Correct.

Test #52:

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

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

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

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.