QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#69631#2662. Bombermanwiktorlewicki100 ✓462ms101884kbC++149.8kb2022-12-29 01:24:452022-12-29 01:24:48

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-29 01:24:48]
  • 评测
  • 测评结果:100
  • 用时:462ms
  • 内存:101884kb
  • [2022-12-29 01:24:45]
  • 提交

answer

#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
using namespace std;
const int N = 1e3 + 5;
int pole[N][N], tury[N][N][7], dr[N][N], n;
pair<int, int> bomba[N][N][7], P, K;
bool odw[N][N][7], fin[N][N];
bool check(int x, int y){
	if(x<1||x>n||y<1||y>n||pole[x][y]==2) return false;
	return true;
}
bool spr(int x, int y, int ile){
	if(x<1||x>n||y<1||y>n||pole[x][y]||ile-dr[x][y]!=1) return false;
	return true;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin>>n;
	for(int i=1;i<=n;i++){
		string S;
		cin>>S;
		for(int j=0;j<n;j++){
			if(S[j]=='#') pole[i][j+1]=1;
			else if(S[j]=='X') pole[i][j+1]=2;
			else if(S[j]=='P') P={i, j+1};
			else if(S[j]=='K') K={i, j+1};
		}
	}
	queue<array<int, 5>> order;
	odw[P.ff][P.ss][0] = true;
	order.push({0, P.ff, P.ss, 0, 0});
	while(!order.empty()){
		auto x = order.front();
 		int i=x[1], j=x[2], b1=x[3], b2=x[4], type=x[0];
		order.pop();
		if(check(i-1, j)){
			int pom1=i-1, pom2=j;
			if(type==0){
				if(pole[pom1][pom2]==0&&!odw[pom1][pom2][0]){
					odw[pom1][pom2][0]=true;
					tury[pom1][pom2][0]=tury[i][j][0]+1;
					order.push({0, pom1, pom2, P.first, P.second});
					bomba[pom1][pom2][0]=P;
				}
				else if(!odw[pom1][pom2][1]){
					odw[pom1][pom2][1]=true;
					tury[pom1][pom2][1]=tury[i][j][0]+1;
					order.push({1, pom1, pom2, pom1, pom2});
					bomba[pom1][pom2][1]={pom1, pom2};
				}
			}
			if(type==1){
				if(!odw[pom1][pom2][2]){
					odw[pom1][pom2][2]=true;
					tury[pom1][pom2][2]=tury[i][j][1]+1;
					order.push({2, pom1, pom2, i, j});
					bomba[pom1][pom2][2]={i, j};
				}
			}
			if(type==2){
				if(!odw[pom1][pom2][2]){
					odw[pom1][pom2][2]=true;
					tury[pom1][pom2][2]=tury[i][j][2]+1;
					order.push({2, pom1, pom2, b1, b2});
					bomba[pom1][pom2][2]={b1, b2};
				}
			}
			if(type==3){
				if(!odw[pom1][pom2][5]){
					odw[pom1][pom2][5]=true;
					tury[pom1][pom2][5]=tury[i][j][3]+1;
					order.push({5, pom1, pom2, i, j});
					bomba[pom1][pom2][5]={i, j};
				}
			}
			if(type==4){
				if(!odw[pom1][pom2][6]&&pole[pom1][pom2]==0){
					odw[pom1][pom2][6]=true;
					tury[pom1][pom2][6]=tury[i][j][4]+1;
					order.push({6, pom1, pom2, b1, b2});
					bomba[pom1][pom2][6]={b1, b2};
				}
			}
			if(type==5){
				if(!odw[pom1][pom2][5]){
					odw[pom1][pom2][5]=true;
					tury[pom1][pom2][5]=tury[i][j][5]+1;
					order.push({5, pom1, pom2, b1, b2});
					bomba[pom1][pom2][5]={b1, b2};
				}
			}
			if(type==6){
				if(!odw[pom1][pom2][6]&&pole[pom1][pom2]==0){
					odw[pom1][pom2][6]=true;
					tury[pom1][pom2][6]=tury[i][j][6]+1;
					order.push({6, pom1, pom2, b1, b2});
					bomba[pom1][pom2][6]={b1, b2};
				}
				
			}
		}//////////////////
		if(check(i+1, j)){
			int pom1=i+1, pom2=j;
			if(type==0){
				if(pole[pom1][pom2]==0&&!odw[pom1][pom2][0]){
					odw[pom1][pom2][0]=true;
					tury[pom1][pom2][0]=tury[i][j][0]+1;
					order.push({0, pom1, pom2, P.first, P.second});
					bomba[pom1][pom2][0]=P;
				}
				else if(!odw[pom1][pom2][1]){
					odw[pom1][pom2][1]=true;
					tury[pom1][pom2][1]=tury[i][j][0]+1;
					order.push({1, pom1, pom2, pom1, pom2});
					bomba[pom1][pom2][1]={pom1, pom2};
				}
			}
			if(type==1){
				if(!odw[pom1][pom2][2]){
					odw[pom1][pom2][2]=true;
					tury[pom1][pom2][2]=tury[i][j][1]+1;
					order.push({2, pom1, pom2, i, j});
					bomba[pom1][pom2][2]={i, j};
				}
			}
			if(type==2){
				if(!odw[pom1][pom2][2]){
					odw[pom1][pom2][2]=true;
					tury[pom1][pom2][2]=tury[i][j][2]+1;
					order.push({2, pom1, pom2, b1, b2});
					bomba[pom1][pom2][2]={b1, b2};
				}
			}
			if(type==3){
				if(!odw[pom1][pom2][5]){
					odw[pom1][pom2][5]=true;
					tury[pom1][pom2][5]=tury[i][j][3]+1;
					order.push({5, pom1, pom2, i, j});
					bomba[pom1][pom2][5]={i, j};
				}
			}
			if(type==4){
				if(!odw[pom1][pom2][6]&&pole[pom1][pom2]==0){
					odw[pom1][pom2][6]=true;
					tury[pom1][pom2][6]=tury[i][j][4]+1;
					order.push({6, pom1, pom2, b1, b2});
					bomba[pom1][pom2][6]={b1, b2};
				}
			}
			if(type==5){
				if(!odw[pom1][pom2][5]){
					odw[pom1][pom2][5]=true;
					tury[pom1][pom2][5]=tury[i][j][5]+1;
					order.push({5, pom1, pom2, b1, b2});
					bomba[pom1][pom2][5]={b1, b2};
				}
			}
			if(type==6){
				if(!odw[pom1][pom2][6]&&pole[pom1][pom2]==0){
					odw[pom1][pom2][6]=true;
					tury[pom1][pom2][6]=tury[i][j][6]+1;
					order.push({6, pom1, pom2, b1, b2});
					bomba[pom1][pom2][6]={b1, b2};
				}
				
			}
		}//////////////////
		if(check(i, j-1)){
			int pom1=i, pom2=j-1;
			if(type==0){
				if(pole[pom1][pom2]==0&&!odw[pom1][pom2][0]){
					odw[pom1][pom2][0]=true;
					tury[pom1][pom2][0]=tury[i][j][0]+1;
					order.push({0, pom1, pom2, P.first ,P.second});
					bomba[pom1][pom2][0]=P;
				}
				else if(!odw[pom1][pom2][1]){
					odw[pom1][pom2][1]=true;
					tury[pom1][pom2][1]=tury[i][j][0]+1;
					order.push({1, pom1, pom2, pom1, pom2});
					bomba[pom1][pom2][1]={pom1, pom2};
				}
			}
			if(type==1){
				if(!odw[pom1][pom2][3]){
					odw[pom1][pom2][3]=true;
					tury[pom1][pom2][3]=tury[i][j][1]+1;
					order.push({3, pom1, pom2, i, j});
					bomba[pom1][pom2][3]={i, j};
				}
			}
			if(type==2){
				if(!odw[pom1][pom2][4]){
					odw[pom1][pom2][4]=true;
					tury[pom1][pom2][4]=tury[i][j][2]+1;
					order.push({4, pom1, pom2, i, j});
					bomba[pom1][pom2][4]={i, j};
				}
			}
			if(type==3){
				if(!odw[pom1][pom2][3]){
					odw[pom1][pom2][3]=true;
					tury[pom1][pom2][3]=tury[i][j][3]+1;
					order.push({3, pom1, pom2, b1, b2});
					bomba[pom1][pom2][3]={b1, b2};
				}
			}
			if(type==4){
				if(!odw[pom1][pom2][4]){
					odw[pom1][pom2][4]=true;
					tury[pom1][pom2][4]=tury[i][j][4]+1;
					order.push({4, pom1, pom2, b1, b2});
					bomba[pom1][pom2][4]={b1, b2};
				}
			}
			if(type==5){
				if(!odw[pom1][pom2][6]&&pole[pom1][pom2]==0){
					odw[pom1][pom2][6]=true;
					tury[pom1][pom2][6]=tury[i][j][5]+1;
					order.push({6, pom1, pom2, b1, b2});
					bomba[pom1][pom2][6]={b1, b2};
				}
			}
			if(type==6){
				if(!odw[pom1][pom2][6]&&pole[pom1][pom2]==0){
					odw[pom1][pom2][6]=true;
					tury[pom1][pom2][6]=tury[i][j][6]+1;
					order.push({6, pom1, pom2, b1, b2});
					bomba[pom1][pom2][6]={b1, b2};
				}
			}
		}///////
		if(check(i, j+1)){
			int pom1=i, pom2=j+1;
			if(type==0){
				if(pole[pom1][pom2]==0&&!odw[pom1][pom2][0]){
					odw[pom1][pom2][0]=true;
					tury[pom1][pom2][0]=tury[i][j][0]+1;
					order.push({0, pom1, pom2, P.first ,P.second});
					bomba[pom1][pom2][0]=P;
				}
				else if(!odw[pom1][pom2][1]){
					odw[pom1][pom2][1]=true;
					tury[pom1][pom2][1]=tury[i][j][0]+1;
					order.push({1, pom1, pom2, pom1, pom2});
					bomba[pom1][pom2][1]={pom1, pom2};
				}
			}
			if(type==1){
				if(!odw[pom1][pom2][3]){
					odw[pom1][pom2][3]=true;
					tury[pom1][pom2][3]=tury[i][j][1]+1;
					order.push({3, pom1, pom2, i, j});
					bomba[pom1][pom2][3]={i, j};
				}
			}
			if(type==2){
				if(!odw[pom1][pom2][4]){
					odw[pom1][pom2][4]=true;
					tury[pom1][pom2][4]=tury[i][j][2]+1;
					order.push({4, pom1, pom2, i, j});
					bomba[pom1][pom2][4]={i, j};
				}
			}
			if(type==3){
				if(!odw[pom1][pom2][3]){
					odw[pom1][pom2][3]=true;
					tury[pom1][pom2][3]=tury[i][j][3]+1;
					order.push({3, pom1, pom2, b1, b2});
					bomba[pom1][pom2][3]={b1, b2};
				}
			}
			if(type==4){
				if(!odw[pom1][pom2][4]){
					odw[pom1][pom2][4]=true;
					tury[pom1][pom2][4]=tury[i][j][4]+1;
					order.push({4, pom1, pom2, b1, b2});
					bomba[pom1][pom2][4]={b1, b2};
				}
			}
			if(type==5){
				if(!odw[pom1][pom2][6]&&pole[pom1][pom2]==0){
					odw[pom1][pom2][6]=true;
					tury[pom1][pom2][6]=tury[i][j][5]+1;
					order.push({6, pom1, pom2, b1, b2});
					bomba[pom1][pom2][6]={b1, b2};
				}
			}
			if(type==6){
				if(!odw[pom1][pom2][6]&&pole[pom1][pom2]==0){
					odw[pom1][pom2][6]=true;
					tury[pom1][pom2][6]=tury[i][j][6]+1;
					order.push({6, pom1, pom2, b1, b2});
					bomba[pom1][pom2][6]={b1, b2};
				}
			}
		}///////
	}
	int ans=1e9, who=0;
	string droga="";
	for(int i=0;i<=6;i++){
		if(tury[K.first][K.second][i]&&tury[K.first][K.second][i]<ans){
			ans=tury[K.first][K.second][i];
			who=i;
		}
	}
	int bomb1= bomba[K.first][K.second][who].first, bomb2=bomba[K.first][K.second][who].second;
	for(int i=bomb1;i>=1;i--){
		if(pole[i][bomb2]==2) break;
		pole[i][bomb2]=0;
	}
	for(int i=bomb1;i<=n;i++){
		if(pole[i][bomb2]==2) break;
		pole[i][bomb2]=0;
	}
	for(int j=bomb2;j>=1;j--){
		if(pole[bomb1][j]==2) break;
		pole[bomb1][j]=0;
	}
	for(int j=bomb2;j<=n;j++){
		if(pole[bomb1][j]==2) break;
		pole[bomb1][j]=0;
	}
	if(ans==1e9){
		cout<<"NIE";
		return 0;
	}
	queue<pair<int, int>> kolejka;
	kolejka.push(K);
	fin[K.first][K.second]=true;
	while(!kolejka.empty()){
		auto x = kolejka.front();
		kolejka.pop();
		for(auto v : {make_pair(x.first-1, x.second), make_pair(x.first+1, x.second), make_pair(x.first, x.second-1), make_pair(x.first, x.second+1)}){
			if(!fin[v.first][v.second]&&check(v.first, v.second)&&!pole[v.first][v.second]){
				fin[v.first][v.second]=true;
				dr[v.first][v.second]=dr[x.first][x.second]+1;
				kolejka.push(v);
			}
		}
	}
	int help1=P.first, help2=P.second, var=dr[P.first][P.second];
	while(help1!=K.first||help2!=K.second){
		if(spr(help1-1, help2, var)){
			var--;
			help1--;
			droga+='G';
		}
		else if(spr(help1+1, help2, var)){
			var--;
			help1++;
			droga+='D';
		}
		else if(spr(help1, help2-1, var)){
			var--;
			help2--;
			droga+='L';
		}
		else if(spr(help1, help2+1, var)){
			var--;
			help2++;
			droga+='P';
		}
	}
	cout<<ans<<"\n";
	cout<<bomb1<<" "<<bomb2<<"\n";
	cout<<droga<<"\n";
	return 0;
}

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

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

input:

5
P..X.
X....
..X..
....X
.X..K

output:

8
1 1
PDDDPDPP

result:

ok 

Test #2:

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

input:

5
....P
.XXXX
.....
XXXX.
K....

output:

16
1 5
LLLLDDPPPPDDLLLL

result:

ok 

Test #3:

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

input:

2
PX
.K

output:

2
1 1
DP

result:

ok 

Test #4:

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

input:

2
P.
K.

output:

1
1 1
D

result:

ok 

Test #5:

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

input:

2
P.
.K

output:

2
1 1
DP

result:

ok 

Test #6:

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

input:

2
PX
XK

output:

NIE

result:

ok NIE

Test #7:

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

input:

3
P.X
...
X.K

output:

4
1 1
DPDP

result:

ok 

Test #8:

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

input:

10
XXXX...X..
X.KX.X....
X.....XX..
X.XXX..X..
X.X...X.X.
X....X..X.
XXXX..X...
......X.XX
.XXXXXP...
........X.

output:

21
9 7
PGGPPGGGGGLLLGLLDDLLG

result:

ok 

Test #9:

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

input:

10
......X...
.PX...X...
.XX.....X.
....X...X.
.XXXX..X..
X.....XX.X
..........
.X.....XX.
.......XK.
..........

output:

18
2 2
GPPDDPPDDDDDDDPPPG

result:

ok 

Test #10:

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

input:

9
....X....
...X..X..
..X..X..X
.X..X..X.
X..X..X..
..X..X...
.XP.X..X.
..XX..XK.
.....X...

output:

40
7 3
PGPGPGPGPGGLLDLDLDLDLDLDDDPPPPGPGPGPPDDL

result:

ok 

Test #11:

score: 0
Accepted
time: 345ms
memory: 101812kb

input:

1000
.......X...X.....X..........X.X...XX......XXX...XX.............X...X.................X.X......X....XX..XX...........X...XX..XXXXX.XXXX....X.XXXX.....X...X...X......X.......X..XX........X....XX...X.....X.XX.X.XX.X...X.........X.X...X...............X.....XX..X...X.......X.XXXX....X.XX.X......X......

output:

1097
365 683
DDLLDDDLDDDLDDDDDDDDLDDLLDDDLDLLLLDDDDDDLLLLDDDDLLDLLLLDDLDDDLLLLLLLLLDDDDDDDDDDDDDDDDDDLDDLDLDDDDLLLLLLDDLLLDDLDDDDDLDLDDLDDDLDDDLDDDLLDLDLDDDDLDDDLLDDDLLDDLDLDDLLDDLLLLDLDLDDDDDDLDLDDLLDLLDLLDDLLDLDDDLDDDDDDLLLDDDDDLLLDDDDDDDDDDDDDDLDDLLLDLDDDDDDDLDDDLDDDDLDDDDDDDDDDDDLLLDDDDDDDDDDDDD...

result:

ok 

Test #12:

score: 0
Accepted
time: 343ms
memory: 101656kb

input:

1000
...X..XX.X..X.......XXX...X........XX.XX....XX..X...............XX...XXX..XX.X.......X...X.X.X...X..X.....X....X.X..XX.X..XXX...X........XX...XX....X..X..X...X..X...........XX......XX.X.....XX...X...XX..X..XXXX..X...X.XX....XX.X.XX.......X..XXX................X.....X.XX.........X..X...X.X.........

output:

626
289 793
LLLLLLLGGGLLDDDDDLDDDDLDDDDDLDLLLDDDDLLDLLLLDLDLLDLDDDDDDDLLLLLDLLLLLDDLDLDDDDDDLDDDDDDDDDDDLDDLLDDDDDDLDDLLDLDDDLLDDLDDLLLDLLLDDLDDDDLDLDDDDLLLLLDLDDDDLLLLLLLDLLLDLDLLDLLDDDLDLDDDDLDDLDDLLDDDDDDDDDDLDDDLDLLLDDPDDDDDDDDLLDLDDDDDLDLLDDLDDDDLDDDDDLLDDDDDDDLDDDDDDDLLLDDDDLLDLLDDLDLDLDDDLLLD...

result:

ok 

Test #13:

score: 0
Accepted
time: 304ms
memory: 101656kb

input:

1000
.X..X..X...XX....X....X....X.XX....X....XX..........X...X..X.X.XX.X...XX...X.XX..X...X.X....XXX.X.XXX.....X.X.....X.......XX..X.XX.XX...X...X...XXXXXX...XXX..X...X.X...X.X.....X...X.......XX..X..XXX.XX...XX......X.XX.XX.....X...X...X.X......X..X.....X.X..XX.X....X..X.X..X..X..X.XX.X.XX...X....X...

output:

1053
529 417
LDLDDDDDDLDDPDPDDDDPDDPDDDDDPPPPDPPPDDDDPPPPPDPDPDPPPPPPPDPPPPPDPPPPPPDPPDPPPPPPPPGPGGPPPPPDPDDDPPPGPPPDPPDPPPPDPDDDDLDDDDDDDDDDDLDDPPDPDPDDPDDDDDPDPDPDDDDDDDPPDDLDDDDDDPPPDDDPDPPPPPGPPPDDDDDDDDDPDDDDDLDLDDDDDDPPDDDDPDDLLDDDDDDDDPDDDPPPDPPPDDDDPPDPPPPPPDPPPPPPPPPPPPPPPDDPPPPPPDPDDPPPPDP...

result:

ok 

Test #14:

score: 0
Accepted
time: 8ms
memory: 7532kb

input:

1000
...XXX.XX...X......X...........XXXX.XXX..XXX...XX.XXX.XXX.X.......X..X...X.X...XX......X.X...X...XX..X.X.....XX..X.X.X.XXXX..X.X.X...X.X.......XX..X...X...XX.X.XX.X..X.X....X.X..X.X....X.X.....X....X.X.XX.XX.X..X...X..XX..X...XXX.X..X..X.XX.X.........XXX..XX.X..X..X..X.X.XX....X...XXX...X.X.X.X...

output:

NIE

result:

ok NIE

Test #15:

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

input:

1000
XX...X.XX.XX.X..X..X..X...X..X.X....X.X.....X.X....XXXXX.XXX...X....XX.X.X.XX.X....X..XX.X...X.....XX....XX....X.X....X..XXX.XXXXXX.X....X.X....X..X..XXX.X..X.XX.X..XX..XXXX.XX.....X..X.X..X.XXXX...X.XXX.....X..XXXX.X..XX..XX.......X..XX..XXXX.XXXX..X...XX..X....XX.X...X.X..X..X.X.XXX.XX...XXXX...

output:

NIE

result:

ok NIE

Test #16:

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

input:

7
P......
.......
.......
.......
.......
.......
......K

output:

12
1 1
DDDDDDPPPPPP

result:

ok 

Test #17:

score: 0
Accepted
time: 239ms
memory: 101644kb

input:

999
..X.XXXXX.X.XX.XX.X..XX..XXX..XX....XX...X.XXXXX..XXX..X.XX.XXX.X..X.XXXXX.X.XXXXXXXXXXXXXXX...XX.X..X...X.....X.XXXX.X..XXXX.XX.X.XXXXXXX..XXX.XXXX.X.XX.XX.X..X..XXXXX.X.XXXX..X.XXXX..X.XXX.XXXXX...XX....XXXXXXX.XXXXX....X.X.XXXXXX..XXX.XXXXX.XXXX.XXXXXXXXXXXXXXXX.X..X.XXXX.X.X..XXXX..XXXX..XXX...

output:

2179
992 994
DDDDDDLLGGLLLGGGGGGGGGGGGGLLDDDDDDLLGGGGGGGGGGGGGGGGGGLLGLLLGLLLLLLGGLGGLLLGGGPGGLLLLLLGLLLGLLLLLLGGLLLGGGLLLLLLGGLGLLGGGGGGGGLLLLLLGGLGGLGGLGLLLLLLGGLGGPGGPPGGGGGGGGGGGGLLGGLGGPGGPGGPGGGGGGGLLDDLLLLLLLLLGGGGGGGGGGGGGGPPGGGGGGGGGLLGGLGGPGGGGGGGGGGLLLGGGGLLLLLLGGLLLGGGGGGGLLGGGGGGGGGPPGG...

result:

ok 

Test #18:

score: 0
Accepted
time: 64ms
memory: 63356kb

input:

999
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

270890
608 95
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...

result:

ok 

Test #19:

score: 0
Accepted
time: 128ms
memory: 99920kb

input:

999
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

253897
32 15
PGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGG...

result:

ok 

Test #20:

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

input:

2
KX
XP

output:

NIE

result:

ok NIE

Test #21:

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

input:

10
XX........
XXX.....K.
.XXX......
..XXX.....
...XXX....
....XXX...
.....XXX..
......XXX.
.P.....XXX
........XX

output:

NIE

result:

ok NIE

Test #22:

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

input:

2
PK
..

output:

1
1 1
P

result:

ok 

Test #23:

score: 0
Accepted
time: 13ms
memory: 11128kb

input:

200
....................X..........................................XX..........X.....................................................................X...................X..................................
..........................................X.......................................................

output:

167
137 107
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGLLLLLLLLLLLLLLLLLGLLLLLLLLLLLLLLL

result:

ok 

Test #24:

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

input:

21
XXXXXXXXXXXXXXXXXXXXX
X..................PX
X.XXXXXXXXXXXXXXXXXXX
X...................X
XXXXXXXXXXXXXXXXXXX.X
X...................X
X.XXXXXXXXXXXXXXXXXXX
X...................X
XXXXXXXXXXXXXXXXXXX.X
X...................X
X.XXXXXXXXXXXXXXXXXXX
X...................X
XXXXXXXXXXXXXXXXXXX.X
X.............

output:

198
2 20
LLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPP

result:

ok 

Test #25:

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

input:

199
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X..................................................................................................

output:

4281
108 189
PPPPPPPPPDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...

result:

ok 

Test #26:

score: 0
Accepted
time: 9ms
memory: 10944kb

input:

200
XXXXXXXXX..XXXXXXXX..XXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXXXXXXXX..XXXXXXXXXXXXX..XXXXXXXX..XXX..XXX..XXXXXXXXXXXXXXXXXX..XXX..XXXXXXXXXXXXXXXXXXX
X.............XX........XX........XX........XX........XX...XX...XX........XX......................

output:

8497
104 104
GGGGGGLLLLLGLLLLLDDLDDDDDDDDDPPPPPPPPPGPPPPGGPGGGGGGGGGGGGLLLLLLLLGLLLLLDDLLLLLDDDDDLLDDDDDDDDDDDDDPPPPPPPPPPPPPPPPPPPPDPPPPPGGGGGGGGGGGGGGGGPGGGGGLGGGGGLLLLLLLLLLLLLLLLLLDDLLLLLLLLLLDDDDDLLDDDDDPDDDDDLDDDDDPDDDDDDDDDPPPPPPPPPPPPPPPPPPPGPPPPPPPPPPDPPPPPGPGGGGGGGGGGLGGGGGGGGGGGGGGGPGGGGG...

result:

ok 

Test #27:

score: 0
Accepted
time: 215ms
memory: 99032kb

input:

1000
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

50730
486 490
DDDDDDDDDDDDDLLLLLLLDDDDDDDDDPPPPPPPPPPPPPPPPPPPGGGGGPPPPPPPPPPPPPPPPPPPPPPPPPGPPPGGGGGGGGGGGGGGGGGGGGGGGGGPPPPPPPPPPGGGGLLLLLLLLLLLLLLLLGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLDLLLLLLLLLLLLLLLLLLLLLLLLLDDDDDDDDLLLLLLLLLLLLLLLLLLDDDDDDDDDDDDDDDDDDDDDDDDDLLDDDDDDDDDDDDDDDDDDDDDDDDDPPPPPPPPPDDD...

result:

ok 

Subtask #2:

score: 20
Accepted

Test #28:

score: 20
Accepted
time: 2ms
memory: 3668kb

input:

10
..........
.########.
.#......#.
.#X##X#.#.
.#X#P.#X#.
.#X#..#X#.
.#X####X#.
.#XXXXX.#.
.#X####X#.
..X..K....

output:

16
4 7
PPGPPPDDDDDDLLLL

result:

ok 

Test #29:

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

input:

2
PK
X#

output:

1
1 1
P

result:

ok 

Test #30:

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

input:

2
#K
P#

output:

2
2 2
PG

result:

ok 

Test #31:

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

input:

50
..................................................
.#..............................................X.
..############################################..X.
#.............................................##X.
.############################################...X.
.............................................

output:

285
26 5
GGGGGGGGGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDPDPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPDPPDDLLLGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDDDDDDLDDDDDPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPDDDDDDLLGGLLLLLLLLLLLLLLLDDDDDDDLLLLLLLLLLLLLDDDDDDDDDDDDDDDDDDDDD

result:

ok 

Test #32:

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

input:

50
K......#####X#####################################
###..#.....#X#####################################
......####.#X#####################################
...###.###.#X#####################################
......#.....X#####################################
#####.#..###X#########.................###...

output:

64
11 27
DDDDPPGGGGGGGGGGGGGGGGGGLLLLLLLLLLGGLLLLLGGLLLGGPPGGGLLLLGLLLLLL

result:

ok 

Test #33:

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

input:

10
P########X
##########
##########
##########
##########
##########
##########
##########
##########
X########K

output:

18
10 2
PDDDDDDDDDPPPPPPPP

result:

ok 

Test #34:

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

input:

11
K..........
XXXXXXXXXX.
#..........
.XXXXXXXXXX
#.........#
XXXXXXXXXX.
...........
.XXXXXXXXXX
...........
XXXXXXXXXX.
P..........

output:

70
5 1
PPPPPPPPPPGGLLLLLLLLLLGGPPPPPPPPPPGGLLLLLLLLLLGGPPPPPPPPPPGGLLLLLLLLLL

result:

ok 

Test #35:

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

input:

5
##..#
.PX#.
.XXX.
#.XK#
.#.#.

output:

8
1 5
GPPPDDDL

result:

ok 

Test #36:

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

input:

7
.......
.......
###X###
#PX.XK#
###X###
.......
.......

output:

NIE

result:

ok NIE

Test #37:

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

input:

45
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
X.#...X..........XX.......XX#X#....XX.......X
#.#.X.#...X...###XX......#XX....#..XX..#..##.
..#.#.#..........XX.......XX.......X#........
..#.#.#...#.#X###XX.........#....#XX#........
X.#.#.#..........XX..............#.XX.......X
X.#.#.#.XX.######X#.....

output:

232
42 5
LDDLDDDDDDDDDDDDDDDDDDDDDDDDDDDDLDDDDLLLLLGLLGLLGGGGGGGGGPGGGGGPGPGPGGGGGGGLLLLLGGPPPPPPGGLLLLLLGGPGGGLLDLLDDLDDDDDDDDDLDDDDDDDDDLDDDDDDDDDLLLDLLLLLLLGGGGGPGGGGPGGGGGGGLLGGGGGGGGGGGGGGGLLGGLLLDDLLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL

result:

ok 

Test #38:

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

input:

45
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X...X...XXX..XXX.XX.X.X#.#XX.X#.XX....#.X.XXX
XX.X......#.#X.#X..X...X..XX.........X...X.XX
X......#..X....XX...X#..X.XX..#.X..........XX
XXX..#....##...X...X.XXXXXXX.X..XX.XX...#..XX
X..XX...XX.XX..X.XX#..X...XX.#.X...XX....#.XX
XXX.#XXXXXX...#X.XX#....

output:

NIE

result:

ok NIE

Test #39:

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

input:

45
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X...#........##.#.....#...XX.......XX...#...X
X.X.........#.................X...........#.X
X....XX...#...........#X....#.#.X........X..X
X.#..X.X...........##.X.#...X..#.X...##.....X
X.#..........#..#.........................#.X
X...............#...#...

output:

NIE

result:

ok NIE

Test #40:

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

input:

45
.##X#X.#.XXXXX.X.#.XXXX#.X#.#.XX...X#..X#X#..
X.......XX.......XX............#..#..#..#...X
X...#........#...XX.....#....#.........#..#.X
X.............................#..#.......#..X
X..#..K.....#..........#....#.....#..#.....#X
X.........................XX.#..#..XX..#....X
X.#........#............

output:

215
5 38
GLLGLLGLLLLLLLLGLLDLLLLLDDLLLGLLLLLDLLGLLLLLLGGGGGGGGGPPPPPPPGPPPPPGPPDPPPPPGPPPPDPPPPPGGPGGGGGGLLLLLLLLLLLLLGLLLLLLLLLLLGLLDLLLGLLLGGLGGPGGPPGPPPPPPPPPPPPPGGPPPPPPPPPPPDPPPPPGGPPGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL

result:

ok 

Test #41:

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

input:

45
XXX#.#X#X..####.###.X.#X####X.#X.#X##...X####
X.......XX.......XX...#.#.XX..............#.#
........XX.......XX.#.....#X.................
#.......XX.......XX.#...#........#...........
#..##...XX.....##...#.X.#........#.XX.......#
.....K................#............XX.....#..
....#...........#...#...

output:

74
42 44
GGGGGGGGGGGGGLGGGGGLLLGGLLLLLGGLLGGGGGLLLLLLLLGGGGLLGGLGGGLLLLLLLLLLLLLLLL

result:

ok 

Test #42:

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

input:

45
X.#XXX#X#.X.#..X#XXXX.XX#..X#.X###X.XXXX##..X
X.#..P......................................X
X.#.......###.#...............##.##.......#.X
X.#.....................................#.#.X
#..........#..#.#...........#X#..##.....#...X
X...........................................X
X...........####........

output:

NIE

result:

ok NIE

Test #43:

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

input:

45
#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#
#.#...#.XX.#...#.XX..........#...#.XX...#...X
X.#.#.#.XX.#.#.#.XX######....#.#.#.XX.#.#.#.X
..#.#.#.XX.#.#.#.XX..........#.#.#.XX.#.#.#.#
X.#.#.#.XX.#.#.#.XX.######XX.#.#.X.XXK#.#.#.#
#.#.#.#....#.#.#.XX.......XX.#.#.#.XX.#.#.#.X
..#.#.#....#.#.#.XX##...

output:

334
34 3
GGGGGGGGGGLLLGGGGGGGGGGGGGGGGGGGGGGPGGPPGPPPPPPPGGGGGGPPDDDDDDPDDPDDDDDDDDDDLLDDDDDDLDDDLLLDDPPPPPPDDLLLLLLDDPPPPDDDPPPPPPGGGPGGGGGGPGGGLGGGGGGGGGGGGGGGGGGPPPPGGLLLLLLGGPPPPPPPPPDDDDPPDDDLLDDPPPPPPDDLLLLLLDDPPDDDPPPPDDLLLLLLDDPPPPPPDDDDDDDDDDDLDDDPPGPPGGGGPPPPPPGGLLLLLLGGGGGGGPPPPPPGGLLLLLL...

result:

ok 

Test #44:

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

input:

2
K#
#P

output:

2
2 1
LG

result:

ok 

Test #45:

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

input:

2
XP
K#

output:

2
2 2
DL

result:

ok 

Test #46:

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

input:

2
K#
XP

output:

2
1 2
GL

result:

ok 

Test #47:

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

input:

2
K#
PX

output:

1
2 1
G

result:

ok 

Subtask #3:

score: 30
Accepted

Dependency #2:

100%
Accepted

Test #48:

score: 30
Accepted
time: 17ms
memory: 11288kb

input:

200
....#.X.........#..X.XX.....#.....##.......#X.#.#.##..X...###.#....##.##.######XX.#...#.....#......#..X..#...##.#X........#.........XX#..X..X............#..X#.X.#.#X......##.#.X.....X................#
X.#........#....#...#.#...#..#..#....#.......X#X..X.#...#.....##.........#....#...X....X..........

output:

116
66 95
DDDDDLLDDDDDDDPDDDPDDDPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPDDPPPPPPPPPPPDDPPDPPDDPDDPPPPPPPPDDDDPDPPDPPPDPDDDDPPPPPP

result:

ok 

Test #49:

score: 0
Accepted
time: 21ms
memory: 11232kb

input:

200
#.......#XX...##.X..#.#....X.#..#....#XX#...###.#...#.....X##...#.##..........#....#X..#...#..#..X#....#....X.X###X..###X..#X.....#.#.##..#......#....#......#........##...X......#.X.X...X#..#X....#...
.#..#....##..............XX..#....##...#......##....#.........#.X....#.#...........X....###.#X#...

output:

128
115 60
GGGGLGLGGGLGGPGGGGGGGGGGLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLGGGGGLGGGPGPGGPGGGGGGGGLGGGGLGGGGGGGPPPPD

result:

ok 

Test #50:

score: 0
Accepted
time: 11ms
memory: 11192kb

input:

200
.X..........##.XX##.#####....#...#.#X#XX#..##..#.#.##.X..##.#..#......#.#.##...#..XX.#.##...###.....#....#...#.####..###..X##..#.X....##.X..#..##.#.#...#.X.#.X.X.#....##.X###..#X.##X#.X....XX.X####...
.#.....#.###........##.X#.....#..X....X.#.##.#X##....#...#..##..#...#.#.X...X.#..X###...#...#X....

output:

259
129 128
LLLDDLLLLLLDDDDLLGLLLLLDDDDDLLDLLLLLLGLLLDLLLLDLLLLLLDLLDLDDDDPDDDDLDDDPPDDDDLDDDDLDDDDDDLLDDLDLLLLLLLLGLLLDLDLLDDDDDLLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDLDDLLDLLDDDLDDLDDDLLLLLDDLLLLDLDDDD

result:

ok 

Test #51:

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

input:

200
...#.......#..###.#.####.###X....#.#...###..##...#...#.#.#...#...#......###.##.#.###.##.#.......#.#....#..#.##..#.###...#.#..#....#......#.####.X#......###.#..##.###...#.##.X#.#.###...##.#...#......#X
.X#....#..##.####..#.##..#..#...####.#####.#.#.##....#..#..X..#.#...#....##.....#....##.#.#####...

output:

184
94 195
GGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDLLLDLLDLLDDDDDPPG

result:

ok 

Test #52:

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

input:

200
..................#.................................................................................................................................................#...................................
........................................................................................#.........

output:

95
179 140
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPPPPPPPPPPPPPGPPPPPPPPPPPPPPPGPPPPPPP

result:

ok 

Test #53:

score: 0
Accepted
time: 6ms
memory: 11140kb

input:

200
#.XXX#.X..XXX..XXX#X#.X#X###.#.X#XXX#.X.X#.X..#..X.XX###..##X#XXX#.X#.##X.##XX#X..X#X#XX.###..XXXX.X##XXX.XXXX..X#.##...###X##..XX#X####.##X.##X#X.XX##XXX..XX#XXX#XX#.XXXXX..##..X######XXXX.X.#..##XX#
...#..X#..X....#X#..X#XXXX#.#.#.#...X#.X....X...XXX....X.X....X.....#.....XXXXX..X....X..#.#......

output:

406
139 152
GGLGGGGGGPPPGGGGGGLLGGGGGGGGGPPGGGGLGGGGLGGLLLLDLLGGGGGGGLLLLLDDLLGLGLLLDLLLLLGGGGLGGGGGGGGGGLGGGLGGGGLLLLLGGGLGGGGGLLLLLDLLGGLLGLGGGLLLLLLLLDLDLDLLLDDDLLLLLDLLGGGGGGLLLLLLGGLLLGLLLLLGGGGGLGGGLGGPGGLGLLGLGLGGGGGGLLLLLGGGLLLLLLLLLLGLGLLLGLLGGGGGGLGGGLGGGGGGGGGPGPPPDPPPGGGGLGLLGGGGGLLLLLGL...

result:

ok 

Test #54:

score: 0
Accepted
time: 11ms
memory: 10920kb

input:

200
#X..##XX#.XXXXX##.X..X.X.##XX#X#.#X.XX##.##XXXX.###....XX.X##X.X#.#X.XX..#X#X#XXXX..#X###X#XX#.#X#.X.XX.#X.#X##X.X###X...XX#X###X#X#XXXX...#.#X#X###X..XXXX.XXX.X#X#XX#..#.XX#.XX.X..XX..X.XXX..X#.###X#
X.................#..#..XX...........#.....X..X....#...X.X...#.#.......#X.XXX.....##.X.X.X........

output:

1961
193 106
PGGGPGGGPGPPPPPPPPPGGPPDPPPPPPPPDPPDPPGPPPPPPPGPPPPPPPPPGPGPPPPPPPPPGPPPPPPDDPDPPPPPPPPPPPPPGPGPGPPGGGPGPPPPPPPPDDPDDDDDDDDDDPPPPPPPPPPPDPPPPPPPDDPPPPPPPPPDPPPPPGPPPDPPDPPGGPGPGPGPPGGGPPPPPGPPPGPPPPPPPPPPGPPPGPPPPPPGGPGGPGGPPGGPGPPPPPPPPPGGGGLLLGGLLLGLGGGGLLLGLLLGGLGLLLLGLGGLGLLGLLGGLLG...

result:

ok 

Test #55:

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

input:

189
.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
...#.#..XX.#..##.X.##..#..XX...#X....#.....X...X....XXX..#X.X.....XX......#X....XX#....##..#.....#.#.#X.#....

output:

1333
74 39
GGGGGGGGGGLGGGGPGGGPPPPGGGGGGPGGGGGGGGGGGGGGGGGGGGLGLGGGGGGGGGPGGGGGGGGGGGGPPGPPGGGGLGLGGGGGGGGGLGGGGPGGGGGGGGGLGGGLLGGPGGGGPGGGGGGGGGGPPPGPGGPGGGGGGPPGPGPPGGGGGGPGGGGGGGGPPGGGPPGPPPDPPDPDDDDDDDPPDDDDDPPDDDDDPDDDDDDDDDDDDDDDPDDDPDDDDDDDDDDDDDDDDDDDDDDDLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD...

result:

ok 

Test #56:

score: 0
Accepted
time: 6ms
memory: 10696kb

input:

195
XXXXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXXXXXXX
X......#...........#.....XX.....#...#XXX#....##X#.......#.....#.XX.....#....................#..X.#.....

output:

3203
60 44
PPGPPPGGGGLLLLLLLLDDLLLLDDDLLLDDDPDDPPPPPPPPPDPPPPPPPGPPPGGGGGGGGGGGPGGPGGGGGGGGGGGGLLLLLLLLLLLLLLLLLDLLLLLLLLLLLLLLLLLDDDDDDDDDDDDDDDDDDDDDPDDDDDDDPDDDDLDDDDDPPPPPPPPPPPPPPPPPPPPPPPPGPPPPPPGPPPPPPPPPPPDPPPPGGGPPPGGLGGPGGGGPGGGGGGGGGGGGGGGGGGGGGGGLGGGGGGGGGGGGLLLLLLLLDLLLLLLLLDLLLLLLLLLLL...

result:

ok 

Test #57:

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

input:

189
XX#..#X#XX.X#X.#.#.###..#.X.X...#.##XXXXX#XXX.#X.XX.X...#.X#XX.#..X.X##.#X##.X####XXX...#.#..##X#XXXX#.XX###.#X..##X#..###X..XX..X...##X...X..XX#X.##XX.X.#X#..#.X#X.X.#..#XX#X#.#X.X##....XX
#...........#..#....XX..#.#..#.X......##XXX..#...#............XX...X.....#.....##.#XX..X..#....#........XX...

output:

385
170 189
GGGGGGGGGGGGGGGGPPPPPPPPPPPGGGGLGLLLLGLLLLLLLLLLLLLLLLLGGGGGGGGGGGGGGGLLLGGGGGLGGGGGGGGGLLGLGGPGGLGGGGGGGGGLGGGGGGGLLGGPGGGGGPGGGGGGGGGLGGGGGGGGGGGGGGGGGGLLLLGLLLLLLLLGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLGGGGLLLLLLGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLGLGGLLGGGGGGGLLLLLDLLLLLLLLLLLLLGLGGGGGGGGGLLLLGLL...

result:

ok 

Test #58:

score: 0
Accepted
time: 7ms
memory: 10632kb

input:

189
.XX##X##.#X#.#XXX.#.X#..X.#X..###.XX#X###XX#..X#..#.X...X.X#.##..#XX#..##X.#.#X####X.XX####XX.#...X...XX.X#.X#.##X...X#####X##..X..#X##X.X..XXX#..XX#XX#X#...#.X.#X###.XXXX..X#.##...XX#.#X#.
##.....#..#.....#..#XX#.....#..#.....#..#XX#..#.....#..#.....#XX#.....#..#.....#..#XX#.....#..#.....#..#XX...

output:

362
184 179
LDLDLDLDLDLDLDLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL...

result:

ok 

Test #59:

score: 0
Accepted
time: 8ms
memory: 10836kb

input:

195
#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
............XX...........XX...........XX...........XX...........XX...........XX...........XX...........

output:

3398
42 165
LLDDDDDDDDDDDDDPPPPPPDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLDDDDDDDDDDDDDPPPPDDDDDDDPPDDDDDDLDDDLDDDDDDDDDDLLLDDDDDDDDDDPPPDDDDDDDDDDDDDDDDLDDDPDDDDDDDDDDLLLDDDDDDDDDDDDDDDDDDDDDDDDDDPPPDDDDDDDDDDDDDLLLLDDDLLDDDDDDDDDDDDDDDDDDDLLLGGGGGGLLLLLLLLLGGGPPGGGGGGGGGGPGGGGGGGGGGPPGGGGGGGGGGGGGGGGLLGGGG...

result:

ok 

Test #60:

score: 0
Accepted
time: 16ms
memory: 10552kb

input:

189
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X#..#.....#..#.....#..#.....#..#.....#..#.....#..#.....#..#...XX.............................................

output:

497
38 18
PPGGPGGPGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPDPPPPDPPPPPPDDDDDDDPPPPPDPPPPPDDDDDPPPPPDDDDDPPDDPPDPDPDDDDDPPDDDDDDDP...

result:

ok 

Test #61:

score: 0
Accepted
time: 10ms
memory: 10344kb

input:

189
.##X#.##.X..XX#X#...X.X#.XX#.XXXX#XX.XXXX#..##.XX.XX#....X##.X#.XX#.XXX#XX..XX.....##.####X##X.XXXX#..#..X###X##X#...X.#..X#..X.#...XX.#X#.X#..#XX##XXX#.#.#X#.##X.#.X..#XX#XX.X#X..XXXXXX.XX
X.#.#...#.......#...XX.#.#...#...#.#...#.XX.#.#...#...#.#.#...XX...................XX.......#...#.......XX...

output:

1664
177 24
GGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGLLGGLLLLLLLLLGGGGGGGGGGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPDDDDPPPPPPGPPPPGPPPPGGGGPPPPPPPPPPPPPPPPPPPPPPPPPGPPPPPPPPPPPGPPPPGGP...

result:

ok 

Test #62:

score: 0
Accepted
time: 11ms
memory: 10460kb

input:

189
XXXXXXXX#XXXXXXXXX#X..X#X#XXXXX#XXX#XXXXXXXXXXXXXXXX#X#XXXXXXX#XXXXXX#X#X#XXXXXXX#XXXX#XXX#XXXXX#X#XXXXXXXXXX#XXXXXXXXXXX#XXXXXXXXXX#X#XXXXXXXXXXXXXXXXXXXXXX#X#XXXXXXXXXX#XXX#XXXXXXX#XXXXXX
X...#...#.#...#.#.#....X.#...#.X.#.....#......................#X.X.....X.#...#...#.XX...................XX...

output:

2181
19 139
DDDDDDLLLDDLLDDDDDDDDDDDDLDDPDDDDPDDDDDDDDDDDDDDDDDDDDDDLDDDDDDLLLDDLDDLLDDPPDDDDPPPPPPPDDLDDDPDDDDDDDDDDDDDDDDDDPPDDDDDDDDDDDDDDDDDDDDDDDDPPPDDDDLLLLDDPDDLLDDDDDDLDDDDLLDDDLLDDDDPPPPDDLLLDDPDDLDDDDPDDDDPDDDDDDDDLLLLLLDDDDLLLLDDDLLLGGLGGLLLLLGGGGGGLLLLLLLGLLLLLLLLLLDDLLDDLLDDDDLLDDLLLLDL...

result:

ok 

Test #63:

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

input:

189
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#...#...#...#...X.#.X#.#.....#.#.#.......X#...#...#.......X.#.XX...................XX...................XX...

output:

2297
9 14
DDDPPPDDLLLDDLLLDDLLDDPDDDDDPPPDDDDDPPDDPPDPPDDDDPPDDPPGPPPGGGGGPGGPPPGGPPPGGGGPGGGLLGGGGGGLGGPGGLGGLGGPPGGPPGGLLLGGGLLGGGGLGGGGLLLLLGGLLLLLLDLLGGLLDLLGLLGGLLLLDLLLLDDLLDDDDDDLLLDDDDPPDDDDDDDDLLDLLDLLLLDDLLDDDDLLDDLLDDDDDDPPPPDDLLLLDDDDPDDDDDDDDDDPDDPPPPPPPPPPDDDDDDDDDDDDPPPPDPPPPPPPPPPPPP...

result:

ok 

Test #64:

score: 0
Accepted
time: 10ms
memory: 10468kb

input:

189
#X.XXX..X#.#.XX..###XX##.X####X.######X..X.#X#X.#XX#X.X.#.#..X#X...XX.X#X#.##X.#.##X##.X..X#XX#.#XX..##........X...X#.XX#..##.X####.X#X#X#.X#.#.X.X.X.#.#XX.X#..X##X..#...XXXX...#X..XX#..#.#
X...#...#...#...#...XX...................XX.#...#...#...#...#.XX.#...#...#...#...#.XX.#...#...#...#...#.XX...

output:

579
107 137
GLLLLGGLGLLGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLLLLLLLLLLLLLGGGGGGGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGLGGGGGGGGGGGGGGGGGGGPGGGPPPPPPPPPPPGG...

result:

ok 

Test #65:

score: 0
Accepted
time: 9ms
memory: 10184kb

input:

189
X..X#XX#XX###.XX##X.X.##...X#.XX.#X#.###.#X.X##.#..##X..####..#...X..#XXX#.##.X#X#...X#.#.X##.X##..X.#...##.#.#...XXX.#XX##..X.##.##X##.#.XX.#X###..#.X.#..##....#.###X.X.X#X#XX####X.#.X..X.
X...#...#...#...#........#...#...#...#...XX...#...#...#...#...XX...................XX...................XX...

output:

10029
173 82
DDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPPPPPPGPPDPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDD...

result:

ok 

Test #66:

score: 0
Accepted
time: 10ms
memory: 10348kb

input:

189
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X...#...#...#...#...XX...#...#...#...#...XX.#...#...#...#...#.XX...................XX.#...#...#...#...#.XX...

output:

8707
26 173
DPPPPPPPDDLLLLLLLLLLLLLLLLLLDDLDLLDLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLLLLLGGLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLGGLLLDDLLLLLLLLLLLLLLLLLLDDLLLGGGGGGGGLLDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDD...

result:

ok 

Test #67:

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

input:

187
#.##X##...#X.#..##XXXX#X#X..##X#XX###XX##.X.#X#...#XX##.X#X#XXX..X.X.#X..XX...##.#.##XX#..X.##.X#..#X#.#XXX#XX#XX#.X.##XX#X##X#X.X.X#XX#XX#.X.#XX.#.XX.XX....##X.X#..#X#.#X.X..XX#.###X##XX
X...............XX...............XX...............XX...............XX.#...#...#...#.XX...#...#...#...XX...#....

output:

8196
6 179
LGGPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLDDLDDLLLLGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDLLGGGGGLLLDDDDDLLDLLGLLGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGLLD...

result:

ok 

Test #68:

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

input:

200
P#######################################################################################################################################################################################################
###############################################################################################...

output:

398
200 1
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...

result:

ok 

Test #69:

score: 0
Accepted
time: 7ms
memory: 10584kb

input:

190
#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.
..#...#...#...#...XX....................................XX.#...X...#...#...XX.................XX.#...#......

output:

7112
116 141
DDDDPPDDDPPDDDDDDDDDDDDDDDDPPDDDPPDDDDDDDDDDDDDDDDDDDLLLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLDDDLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLDDPPPPP...

result:

ok 

Test #70:

score: 0
Accepted
time: 7ms
memory: 11032kb

input:

198
XX##X.XX.##.X#.##.XXXX#XXXX#X.X.XXX.###X.##X...XX.#X#X#.#X..X...X.#XX#X#..X...XXXX.XX.#..XX..XX#.#XX##XXXX#XX##X###.###X.X#X#.X.XX#X#.#.#.XXX#.XXX.#X#X....X#..X#.#XX.XXXXX.#XXXX.##.X.#X.#XX..#XXX#.#
X...............................XX...............................XX.................................

output:

1229
117 136
GGGGLGGLGGLGGLGGLGGLGGLLLDLLLLDLLLLDLLLLDLLLLDLLLLDLLLLLGGLLLLLLDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDLDDDDDDLLLLLDDDDDDLLLLLLLLLLLDDDPPPPPDDDDPPPPPPDDDDPDDPPPPPPPPDDPPPPPPPPPPGPPPPDPPDPPPPPPDPPPPPD...

result:

ok 

Test #71:

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

input:

190
####XX.#.#.X###XX...X#...#..X###XXXX.X#X###XX.XX##X.##X.X.#X##X####.#X#..#X##XX.XX.#X#XXX#.###.#XXX#.#XX......#.##X#X#..XX.X##.#X.XXXXX#X.X..X.X#..####X#X##.#.#X.#XX..X#XX.#.#.#.X.X..XXXXX..
..................XX.#.X...#.#.#.#...XX.X...#.....#.....XX...#.....#.#.....XX.#...#...#...#...XX............

output:

374
178 155
LLLDDLLLDLLLDLDLLLLGGGLLGLLGLLLLLGGGLLLLLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLLLGGLLLGGGGLGGGGGGGLLGGLGLGGGGLLLLLGGLLLGGGGLLLGGGGGGGGGGGGGGGGLGGLGGGGGGLGGGGGLLGLLLLLLGLLLLLLGLLLLGGLGGGGGGLLLLLGGLLLGGGGGGGLLLLLGGLGLLGLGGLLGGPGGGGPGGLGGGGGGLLLLGLLLLLLGGGLLLLGLLLGGGGGGGGLLLLLLLLLLGGGGGGLLLLLLLL...

result:

ok 

Test #72:

score: 0
Accepted
time: 9ms
memory: 10552kb

input:

195
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X.###..X.....#...#...#......#..#.#...#XX.X...#...#...#...#...#...#...#...#...XX.#...#...#...#...#......

output:

3496
176 160
DDPDDPPPPPDPPPPPPPPPPPPGPPPGPPPDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGG...

result:

ok 

Test #73:

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

input:

189
#XXXX..XXX..#X#X#XXXX..#X...X.....##....X..X##X..X.###XX#X#...XX###.#...###.XX##XX#XX#X##.X#X#.###X#..#..##X##XXX##.XX#XX.XX#.##XX.X.###...#####X#.#X.....#X#.X..XX..#..X..X#X.##.###.X.X..X.
X.#.....XX.......XX.......XX...#..#XX.#.....XX................XX....#..XX.#.....XX...#.#.....................

output:

381
8 11
PPPPPPPDDDPPPPPDDPDDDDDPPPPPPPPPPPPDPDDDDPPPPPPPPPPPPDPPPPPDDDPPPPGPPGGPPPDPDDLDDPPDDDDDDPDDPPPPPPDPPPPPPDDDDDDDDPPPDDDDDDPPPPDDDDDDDDDPDDDDPPPPPPPPDDDDDDLLDDDDDDPPDDPPPDPPDDDPPPPPPPPPPDDDDDPDPPDPPDPPPPPPPDDDDDPDPPDPPDDDPPPPDDDDPDDPPPPPDPDPDPPPDDDDDPPPPDDDDPPPPPDDDDDDDDDDDDDPPPPPDDDPDPPPPPP...

result:

ok 

Test #74:

score: 0
Accepted
time: 16ms
memory: 10936kb

input:

198
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
..#...#...#...#...#...#...#...#...X...#...#...#...#...#...X...#...#...#...#...#...#...#...#...#.....

output:

2682
139 63
PGGGGGGGGGGGGGGGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGGGPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPGGPGPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD...

result:

ok 

Test #75:

score: 0
Accepted
time: 8ms
memory: 11036kb

input:

200
##..X.#......#...X.#.#.#.#.X.#XXXX#.....X...#....X.#...#......#.#....X#.#.X..#XX#....#..X##..###.#..#X..#..........X#...X#....#...#.##...#X.##.#...#..#..#..X###.#.#.X.....X...X..XX...X.......#X#.##...
..#...X#..X.....#X.X##..##.#.##X#X.#.X.#..X....#.X...#X.....#.....#.X.#...#......X...##.X#...#X...

output:

18
65 96
LGGGGGGGGGGLLLLLLL

result:

ok 

Subtask #4:

score: 40
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #76:

score: 40
Accepted
time: 357ms
memory: 101884kb

input:

1000
.#.X#.........X#........X.#X.X..XX...##...............####X..#..#.X....#X.........#..X.#X...##.#.X#....X#....#X#........#.#.X...X......XX.............#.X..........#X#..#.#..#XX..XX...............#..#...##.#...XX......#..#.........X.....#.................#.....#.#.X.....X...X#.#....X.......###.#...

output:

961
104 304
PGGPPGGPGGPPGPGGGPPGPGPPPGPGGGGPGPPGGGGGGGPGPPGGGPPGGGPGGPGGPGPPGGGGPPPPGGGGGGGGPPGGGGGPPPPPPGPPGGGGLGGGGGGGPGGPGPGGGGGGGGPPGPGGGPPPGGPPGPPGGPPGGGGGPGGGGGGGGGGGGGGLGGPGGGGGGGGGGPGPGGGGPGPGGGGPPGGPGPPPPPGGPPPPGGPPPGPGGGGGPPPGGGGPPGGGGGPGGGGGLGGPPGGGGGGGGPGGGGGGGPGPGGGGPGPGGGPPPGPPPGPGGPPP...

result:

ok 

Test #77:

score: 0
Accepted
time: 385ms
memory: 101824kb

input:

1000
X.....#.X..X.#X..#..###.#.X....#.#.....#..X#..X#..#...............X...##...#.....XX..#..#....###...#.#X................XX#...#.....#X....X........#.....#X...#..........#....####....#..#....X.#.#.X.....X...#.X##....#.#X.....X..X##X...#.#.X..XX.#.#X.......#.X......#..#X.X...##.X..X.....#.......X....

output:

774
185 740
DPPDDDPDPPGPPPDPPPPDPDDDDPPDDPDDDDDDLLDDPDDDPPDPDPDDPPDDDDDDDDDDLDDDLDDDPDDDPDDDDDDDDPDDDDDDDDDDDDDLDDDDDLDDDDPDDDDDDPDDPDPDDDLLLDDDDDDDDDDLDDLDLDLLLLDDPPDDDDDPDDDDPPPPDDDDDDDDDDDDDDDDLLLDLDDDDDDDPDDDDDDPDDDPDDDDPDDLDDDDDDDDDDDPDDDLDLDDDPPDPDPPPDPDDDDDLLDLLDLLLDDDDDDDDDLDLDDDDPDPDDDDDDDD...

result:

ok 

Test #78:

score: 0
Accepted
time: 361ms
memory: 101644kb

input:

1000
X..#..X#...X.X....X.#X..##.#....X..#X.#.X##.........#.X#........##.##X..#.X...#.#X.#.X.....X..#.##.....#.#..#XX...#..#X.##.....#...##..#.##.X.#.X##.......#.#...##..#..X#.#.....X#..X.#X.#X..#.....#...#.##.#X...#..#...#X#..X##..#.##....##.XX...#..#..#...#.XX###...###X..#.....X..#..X.X..#..#X.X.X#...

output:

665
692 679
DLLLLGLLLDLLLLDDDLDDDDDDDDDDDLLLDDLLLGLGGGLGLGGGGGLGLLLGGLLLLGGLGLLGGGLLLLLLLLDLLLDLLLLLLGLGGLLDLLLGGLGGGGLGGLLGGGLLLDLDDDDDDLLLLDDDDLDLDDPDDDDDDDDLLLLDDLDDPPDDDDDDDDDDDLDDDLLDDLLGLGLLLLGGLLLGGGGLGLLGGPGGPGGGLLLLLGGGLGLLLLLGLLLLLGGLGLLGGGLLLGLLLLGLLGGLLLLLLLLLLDLLLLLGGLGLLLGGLLLLLDDDLDDL...

result:

ok 

Test #79:

score: 0
Accepted
time: 462ms
memory: 101728kb

input:

1000
#....#.##...#.......##.###.#.#.#..#.........###...#..##..#.X##.##.###.#####..#....X.#..X..#.####.#..#....##X#.#...#.##.#..#.##..####...X...X.X.##...###..#X#.##.#..##...#.#.....##.X.......##.#............##.......#...........#.###..X##.#.....X.##..#.##..##...#.#....###..###..##.......#...##.#.X....

output:

2713
866 866
PGPPGGPPPPDDPPPPDPPDDDDDPDDDPDDPDDDLDDDDLDDDDDDDDDLLDDDDDLLDDDDDLLLLLDDPDDLDLLGLLLLLLLLLLLLLLLLLDDDLDLDDDDLLLLGGGGGGGLLLLLLLDDLLDDLDLLLLLDLLLGLLLLLLDLLLLLLLDLLDDDDLLDDDLLLLDDDLLGLLDDLLLLLLLLLLLLLDDDDDPDPDDDLDDLLDLLLLLLLDLLDLLLLGGLLDLDDDPDDDDDDDDLLDLLDLLLLLLLLLLLLGGLGLLLGLLLLGLLLLLLDLLGL...

result:

ok 

Test #80:

score: 0
Accepted
time: 441ms
memory: 101660kb

input:

1000
...#.#..#..##....#......X.....###....##..X.#...#.......###X##...#.X#.......#...#..X.....#.....###.#....#X.X#X#X#.....#..#..##.X.#....###...X...#...#.#.#.##.#.##..........#.#.#..X..X..XX.X#.....##...#.X....#.#...#.X..#.......#.....#...#.........###.X.#..#.#X..###..#X.......X...#.##......#.X##.##...

output:

1266
656 619
DDLDDLLLLLLLDLLDLLLDLDLDLLDLDDLLLDLLLLLLLLDDDDDDLLLDDDDDDLLDLDLLLLLDLLLLLDDLLDDDDDDDDDDDLLLLLDLLLGGGLLDLLGLLDLLDDDDDDDLDDLDDDLDLDDDDDDDLDDDDDDPDDLDDDPDDLLDDDLLLLLDDDDDLLLDDDDDDLLLLGGLGLLLLDLLLLLLDLLGGGLLLLGLLLLLLDDLLLLDLLLDDLLLDDDLLDDDLLLDDLLLLLDLLLLLLLLDDDDLDDLLLLDLLGLLLDLLLDDDLLLDDDDL...

result:

ok 

Test #81:

score: 0
Accepted
time: 387ms
memory: 101732kb

input:

1000
X....#XX....#.#XX.XX.#X.#XX..#X..X.....#.XX##...X...X...X#......X...#X..XX..X.X..X..#X.X......X#X...X#...X.#.X.#.X.X#.XX.X.#...X.X..X.....#X#X.X#.#X...X...............#.###.#.#.X#X#X..#XX.#.#.X.....X.X............X.#..#.#.....X##.XXX.XX.X..##........X....X....X.X..X.........X#......#.#.##...##X...

output:

996
695 695
DDDLLLDLLLGLLLLLLLLLLLLGLLLLLLGGLLGGGGGLLLLGGGGGGGGGGLGGLGLLGGGGGLGGLLLLDLLLLLDLLLLLLLLLLLLLLLLLLLLLLLLLLDLDDLLLGLLLLLLLLLLLGLLGLLLLGLGGPGGGGGGLLGGGGGGGGGGGGLLGGLLLGLLLLGLLGGGLLLGLLLGLLGGGLGGLGGGGLLGLGLLGLLGLGGGLGLLDLLLGLGGGGLLGGGGGPPGGGLGGGGLGGPGGGGGGLLLGGGGGGLGGLLGGGLLDLLLLGLLLGLGLLLGG...

result:

ok 

Test #82:

score: 0
Accepted
time: 398ms
memory: 101784kb

input:

1000
XX..#X.......#..X.X#X....#.X....XXX..X#......X#...X..X....X.#.##...#..XXX#XX...X.#.#..XX..#.X..XX.....X...X.#XX..#.............X...#......X.XX....X..X.X.......X..XX.X.X..XXXXX.XX..X.#X.#X.#.XX..X.......X#..........XX.X..#XXX.X...#.......##.#X..X..X.X.#X.......XX....X.X#X#..XX#....XX...#X..#X.##...

output:

1016
341 430
DLLLGLLLLLLGLGGLLLLGLLLLLLDLLLLLDLLDDDLLLLDDDLLLDLDDDLLLLLDDLLLLLLDLDLDDLLLLLLDDDDLDDDLDLLLLDLDLLDLDLLDDDDDDDDDDDDDLLLDLLLLLLLLDDLLDLDLLDDDDLLDLDLDDLLLLDDLLLLGLLLLLGLLLLLLLLLLLDLDLLLGGGLLLLDLDDLLLLDDDLDDDDDDLLLLLLLLLLLLLLLLLDDDDLLLLLLLLDDLLLDLLGLLGLLLLLLLGLLGGLLLLLDDDDLLLLLLGLLLGLGLLDDD...

result:

ok 

Test #83:

score: 0
Accepted
time: 9ms
memory: 7500kb

input:

1000
PXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

1001
2 1000
DPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...

result:

ok 

Test #84:

score: 0
Accepted
time: 107ms
memory: 98576kb

input:

969
X.XX##.#..X.X.##X.XX.X.#..XXX#X#X#X#.##X..#.X.X##XXXXXXX##X#X.X.##..X.X.#.XXX#XX###X#.X#.#X###X...XXXXX..X.#X...##XXX.#.XX.XX..##XX#.#X.#.##X...##..##X#.X.X#X#XX#XXX.XX##.X..#...#X..X.#.X##.X#..#X#..XX#XXX#X#X.#X..####.X#X##...X.#X#X#.X###..X#.X..X###...#.#XXX#.X#.X..#XX.XX...XX..X##X#####XX.#.....

output:

1928
955 16
PPGGPGGGPGGPPPPPGGGGGGPPPGGGGGGGGGGGGGGGPPGGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPGPGPGGGGGGGGGGGGGGPPGGGPPPPPPPPGPPPPPGPPPGGPGGGGGGGGGGGGGPPGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPGPGGGGGGPPPGPGGPGGGGPGPGGGGPPPPPPPPPPPGGPGGGGGGGGGGGGPPPGPPPPPGGGGPPPGPPPPPGGPPGPGGGGGGGGGGGGG...

result:

ok 

Test #85:

score: 0
Accepted
time: 300ms
memory: 97236kb

input:

957
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

34718
321 830
DDDLDDDDDDPDDDDLLDDDDDDDDDDDDLDDLDDDDDDDDDLLDDDDDDDDDDDLDDDPDDDDDDDDDDDDDDDDDDDDDDDDDPDDDDDDDDDDDPPDDLDDDDDDDDDDDPDDDPDPPDDDDDDLDDPDDDDDDDLDDLDDDDDDDDDLLDDDPDDDDDDDDDDDLDLDDDPDDDDDDDDDDDDDDDDDPPDDDDDDDDDDDDDDLDDDDLDDDDDDDDLDDDDDLLLDDDDDDDDDDDDDDDDDDDDDDDDDLDDDDDDDDDDDDDPDDDDDDDDDDPPPDD...

result:

ok 

Test #86:

score: 0
Accepted
time: 246ms
memory: 95992kb

input:

969
XXXXXXXXXXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

49339
615 615
DDDLLLLLLLLLLLLLLLLLDLLLLDDDDDDDDDDPPPPPPPPPPPGGPPPPPPPPPPPPPPPPGPPPGPGGGGPGGGGGGGGGGGGGGGGGPGGGGGGGLLLLLLLLLLLGLLLLLLGLLLLLLLLDDDDLLLLLLLLLLLLLLLLLLLDDLLLLLDDDDDDDDDLDDDDDDDDDDDDDDDDDLDDDDDDLDDDDDDDDDDPPDPPPPPPDPPPPPPPPPPPPPPPPPPDPPPPPPPPPPPPPPPPPPPPGPPPPPPPPPPPPPPPPPPDPPPPGGGGPPPGGGG...

result:

ok 

Test #87:

score: 0
Accepted
time: 8ms
memory: 10208kb

input:

969
X.#X#X.##..XX#X.X.....#XX##X##X..#.###......X.#X#.#..X#XX.XX#.XX#.X..#X#X##X#XX..X##X####.#X#X#.X#X##XX.#.X#XX#.#XX#X.X.#...##..##.###X#.X..#.X#.X#..#..#.#.#...###..#XX..#.XX...##XX##...#X#.#.X#XX.#...X#X##.#..X#.X#....#X#XX.####...X.#.X....XX.X##X.#.X#X#.XX#.####XX#XX..X.#XX##XXXX.X.#X###XX.......

output:

NIE

result:

ok NIE

Test #88:

score: 0
Accepted
time: 9ms
memory: 13268kb

input:

969
.#.X...##X#.X#X##.X##XX#.X#X###..#.X.#X#X##.X##.XXX.X...#X##.#X##X####.X##...##.#X.##X.X.XX##..XX.#X.XXXXXX#.X.#..#X###X#.##X..###XXX.X#X##XX...X##XX#.#.X.X.XX.X..X.XX.XX##.X..XXX.#XX.#..#X.XXXXX.#.X.#XX##X#.#.##.X.##X###XX.X#XX#.X.#X.#X#...X#.#.#X..X#.#X.X.#X###XX#.#XX..#XX#XX#X#.#X#.XXX#X#..##...

output:

NIE

result:

ok NIE

Test #89:

score: 0
Accepted
time: 261ms
memory: 96704kb

input:

961
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

31320
946 17
GGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL...

result:

ok 

Test #90:

score: 0
Accepted
time: 243ms
memory: 97840kb

input:

961
#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

34666
21 636
DDDDDDDPPDDPPPPDDPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLDDDDDPPPDDPPDDPPDDDDPPDDLDDLLLLLLDDDDDDDDLLDDPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLDDDDDDDLLLLLLDDLDDDDDDDDDDDDDD...

result:

ok 

Test #91:

score: 0
Accepted
time: 269ms
memory: 97680kb

input:

961
.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

35766
463 109
GGGGGGGGPGGGGGGGGPGGPGGPPGGGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLGGPPGGGGGGPPPGGPGGGGGGGGPGGLLLGGLLGGGGGGLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPGGLGGGGLLLLGGGGGGPGGLGGGGGGGGPGGGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLGGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPPP...

result:

ok 

Test #92:

score: 0
Accepted
time: 334ms
memory: 98068kb

input:

961
.X.#X.XX#.XX#XXX##X#X.X######.XX.X#X#.#.X.X#X...X.##.#.X##....X#XX.#.XX.X.X#.##.....X.X.##..#XXXX#.#XX#X...XX##XX....X...XX..#X.#X..#.###.#XX#X..XX####.#X...XX#X..X.XX.#.X#X.X.#.X#X..##X#X.#X..X.#.#X#..X.#X#X#.###XX#XX#.##.####X#XX.#X.X.X...#.#X#.X#XX#..#.##X###..X#XX#.X##XX.X#.X#.X.XX##.##..#.....

output:

1900
906 948
DDDDDDPDDDDDDDPPPPPPDDDDDDDPPPPDDDPPPPDDDDDDDDPPDPPDPPPPPPPPPPPPGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPDDDDDDPPPPPPDDDDDDLDDDDPPDDPDDPPDDDDDDDPPPPPPDDDDDDDDDDDDDDDDDDDDDDDPPDPPPPDDDDDDDDDDPPDDDPPDDPPDPPPDDDDDPDDDDPPDDPPPPDDPPPDDPPPPPPPPPPPPDDDPDDPPPPDDPPDDDDDPPDDDDDDDPPPPPPDDPPPPPDDDDPPPDDDDDDPP...

result:

ok 

Test #93:

score: 0
Accepted
time: 197ms
memory: 93056kb

input:

969
.X#.#...#X.##.#X#XX#..#XX.####.####.##X#X#XXX.X.X.X.#.##XX#XX###..XXXX.X.##X..X.##XX.X.X###X.#.#X####X###X.X..X#.X.X.X.X#XXXX##XXXXXX#.##X..XX..#X##.X.#XXX.X.X#..#XXX#XXXX.##XX###.#XX.#.X#.X.#X.X.#..XXX.##.XX..#.##.#XX#XX..X.X##.X#.X###.X#.X.XX#.#X.#.##X.X.#..X.#X.##.XX...X.XXX#.#####..X#.XXXX#....

output:

201867
274 952
LLLLLGGLGGLLLLLLLLLLLLLLLLLLGLLLGGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGLLLLLLLLLLLLLLLLLLLGGLLLGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGLLDDDDDDDD...

result:

ok 

Test #94:

score: 0
Accepted
time: 215ms
memory: 97148kb

input:

969
X#X#X##XX.X..XXX#..X#XXX#XXXXXX#X#X.XX.#X.X#.#X.####..#.#XX.XX..X.XX#XXXX#.#XX.X###X#.XX..#.X..#.XX.#..X..#X....X...X.##..X#..#..XX#XXX.X##.#..X.#.X.X..XX.X#.XX.X..#.##X.###.##..XX.#..X.#.#..#.#....#.##X###.X###X...X.X###X##XX#.X##.X#X.#.#XXXXX#.....##.XX.X#X....#X..XX.#XX#########..#.XX.X#.XXXX...

output:

193243
258 921
LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLDLLLGLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG...

result:

ok 

Test #95:

score: 0
Accepted
time: 242ms
memory: 97504kb

input:

975
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

227680
257 709
PPPPPPPPPPPPPPPPPPPPPPPPPPDDPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGG...

result:

ok 

Test #96:

score: 0
Accepted
time: 431ms
memory: 100668kb

input:

989
####X#X..#X...XX#X#..#.X#.#.X.##..##X#.XX##...X##XX####..X#..XXX#.X#XXX##..####....X....##.###..#X#.XXXXX###.XX...#.#...X#X#####X.#.X#X#X##.X#.X##X##..X.XXX.X.X..XXX.#XX..X##X.X#.#XX...XX##..XX##XX#.X###X.#####X##XXXXX#XX.XX.##X..X.X#.#X.#.###XX...##.#...#X#.##X#XX#X#X#X##.#..X#XX#.XXXXX##..#XXX...

output:

3287
584 69
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLGLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL...

result:

ok 

Test #97:

score: 0
Accepted
time: 133ms
memory: 97752kb

input:

961
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

204727
510 1
GPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGGGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLL...

result:

ok 

Test #98:

score: 0
Accepted
time: 249ms
memory: 96924kb

input:

961
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

97435
329 624
GGPGGGGGPPPPGPGGPPPGPGGPPPPPPGGPPPPGPPPGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDLDLDDDDDDDDDDDDLDDDDDDDDLDDDDDPDPDDDDDDDDDPDDDDDDDDDDPPPDDPPDPDDPDPPPPPDPDDPPDDPPPPPPPPPDPPPPPPDDPDPPPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDD...

result:

ok 

Test #99:

score: 0
Accepted
time: 328ms
memory: 97748kb

input:

961
.#XX#..#..X..#.#XX##.X.#...X.#X#.X.X.#XX#X..###X.#XX##..X#.#X.##.X#X....#X#...##X#.#X.X#...X##.X.###X###XX.X...XX.X.#.XX.XXX.#....##.#X..X#...X..#.#...#XX#.X#.##.##X..#X#.#..XXX.#XX#.X..#X#.X...X#..XX#.#XX#....XX.##XXX.#.#..X.X###XXX..X####X#.#XXX#XX.XX......##.##XXX##.#X.#.#XXXX.X.XX#...X..#XXX...

output:

2921
33 946
LLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPGGGPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLL...

result:

ok 

Test #100:

score: 0
Accepted
time: 377ms
memory: 101416kb

input:

999
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

5664
295 856
PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...

result:

ok 

Extra Test:

score: 0
Extra Test Passed