QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#259623#2662. Bombermanmikefeng100 ✓1978ms55292kbC++144.2kb2023-11-21 08:13:342023-11-21 08:13:35

Judging History

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

  • [2023-11-21 08:13:35]
  • 评测
  • 测评结果:100
  • 用时:1978ms
  • 内存:55292kb
  • [2023-11-21 08:13:34]
  • 提交

answer

bool M1;
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<iomanip>
#include<cassert>
#include<random>
#include<cstdio>
#include<vector>
#include<bitset>
#include<stack>
#include<queue>
#include<deque>
#include<cmath>
#include<ctime>
#include<map>
#include<set>
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/hash_policy.hpp>
//#include<ext/pb_ds/priority_queue.hpp>
#define fi first
#define se second
#define ll long long
#define Vector Point
#define I128 __int128
#define LD long double
#define ull unsigned ll
#define pii pair<ll,int>
#define pb(x) push_back(x)
#define syt cerr<<"sytakioi\n"
#define F(i,a,b) for(int i=a,i##end=b;i<=i##end;++i)
#define UF(i,a,b) for(int i=a,i##end=b;i>=i##end;--i)
#define look_memory cerr<<abs(&M2-&M1)/1024.0/1024<<'\n'
#define rd_i(l,r) uniform_int_distribution<int>(l,r)(rd)
#define rd_r(l,r) uniform_real_distribution<double>(l,r)(rd)
#define look_time cerr<<(clock()-Time)*1.0/CLOCKS_PER_SEC<<'\n'
using namespace std;
//using namespace __gnu_cxx;
mt19937 rd(time(0));
const int N=1005;
int fx[4]={0,1,0,-1};
int fy[4]={1,0,-1,0};
int n,sx,sy,tx,ty,ans;
int hx,hy,lx,ly,f;
char c[N][N];
int dis1[N][N],dis2[N][N];
pii lst1[N][N],lst2[N][N];
inline void solve(int x,int y,int dis[][N],pii lst[][N]){
	F(i,1,n) F(j,1,n) dis[i][j]=0x3f3f3f3f;
	queue<pii> q;
	dis[x][y]=0;
	q.emplace(x,y);
	while(!q.empty()){
		pii tmp=q.front();q.pop();
		int x=tmp.fi,y=tmp.se;
		F(i,0,3){
			int tx=x+fx[i],ty=y+fy[i];
			if(!tx||!ty||tx>n||ty>n||c[tx][ty]=='X'||dis[tx][ty]<=dis[x][y]+1) continue;
			dis[tx][ty]=dis[x][y]+1;
			lst[tx][ty]={x,y};
			if(c[tx][ty]!='#') q.emplace(tx,ty);
		}
	}
//	F(i,1,n){F(j,1,n) cout<<dis[i][j]<<' ';cout<<'\n';}cout<<'\n';
}
vector<pii> res;
inline void out(pii x,pii y){
	if(x.se+1==y.se) cout<<"P";
	if(x.se==y.se+1) cout<<"L";
	if(x.fi+1==y.fi) cout<<"D";
	if(x.fi==y.fi+1) cout<<"G";
}
inline void out1(pii x){
	if(!x.fi||!x.se) return;
	out1(lst1[x.fi][x.se]);
	res.emplace_back(x);
}
inline void out2(pii x){
	if(!x.fi||!x.se) return;
	res.emplace_back(x);
	out2(lst2[x.fi][x.se]);
}
bool M2;
signed main(){
	int Time=clock();
	look_memory;
	cin.tie(nullptr)->sync_with_stdio(false);
	cin>>n;
	ans=n*n+1;
	F(i,1,n) cin>>(c[i]+1);
	F(i,1,n) F(j,1,n){
		if(c[i][j]=='P') sx=i,sy=j;
		if(c[i][j]=='K') tx=i,ty=j;
	}
	solve(sx,sy,dis1,lst1);
	solve(tx,ty,dis2,lst2);
	F(i,1,n){
		F(j,1,n) if(c[i][j]!='X'){
			int l=i,r=i;
			while(l&&c[l][j]!='X') --l;++l;
			while(r<=n&&c[r][j]!='X') ++r;--r;
			int L=j,R=j;
			while(L&&c[i][L]!='X') --L;++L;
			while(R<=n&&c[i][R]!='X') ++R;--R;
			pii mn1={1e9,0},mn2={1e9,0};
			F(k,L,R) mn1=min(mn1,{dis2[i][k]+abs(k-j),k});
			F(k,l,r) mn2=min(mn2,{dis1[k][j]+abs(k-i),k});
//			if(i==2&&j==3) cout<<mn1.fi<<' '<<mn1.se<<'\n'<<mn2.fi<<' '<<mn2.se<<'\n';
			if(mn1.fi+mn2.fi<ans){
				ans=mn1.fi+mn2.fi;
				hx=i;hy=mn1.se;
				lx=mn2.se;ly=j;
				f=0;
			}
		}
	}
	F(i,1,n){
		F(j,1,n) if(c[i][j]!='X'){
			int l=i,r=i;
			while(l&&c[l][j]!='X') --l;++l;
			while(r<=n&&c[r][j]!='X') ++r;--r;
			int L=j,R=j;
			while(L&&c[i][L]!='X') --L;++L;
			while(R<=n&&c[i][R]!='X') ++R;--R;
			pii mn1={1e9,0},mn2={1e9,0};
			F(k,L,R) mn1=min(mn1,{dis1[i][k]+abs(k-j),k});
			F(k,l,r) mn2=min(mn2,{dis2[k][j]+abs(k-i),k});
			if(mn1.fi+mn2.fi<ans){
				ans=mn1.fi+mn2.fi;
				hx=i;hy=mn1.se;
				lx=mn2.se;ly=j;
				f=1;
			}
		}
	}
	if(ans==n*n+1) cout<<"NIE\n";
	else if(f){
		cout<<ans<<'\n'<<hx<<' '<<ly<<'\n';
		out1(lst1[hx][hy]);
		if(hy>ly) UF(i,hy,ly) res.emplace_back(hx,i);
		else F(i,hy,ly) res.emplace_back(hx,i);
		if(hx>lx) UF(i,hx-1,lx) res.emplace_back(i,ly);
		else F(i,hx+1,lx) res.emplace_back(i,ly);
		out2(lst2[lx][ly]);
		F(i,1,int(res.size())-1) out(res[i-1],res[i]);
	}else{
		cout<<ans<<'\n'<<hx<<' '<<ly<<'\n';
		out1(lst1[lx][ly]);
		if(lx>hx) UF(i,lx,hx) res.emplace_back(i,ly);
		else F(i,lx,hx) res.emplace_back(i,ly);
		if(ly>hy) UF(i,ly-1,hy) res.emplace_back(hx,i);
		else F(i,ly+1,hy) res.emplace_back(hx,i);
		out2(lst2[hx][hy]);
//		for(pii x:res) cout<<x.fi<<' '<<x.se<<'\n';
		F(i,1,int(res.size())-1) out(res[i-1],res[i]);
	}
	look_time;
	return 0;
}

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

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

input:

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

output:

8
1 1
PDDDPDPP

result:

ok 

Test #2:

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

input:

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

output:

16
1 1
LLLLDDPPPPDDLLLL

result:

ok 

Test #3:

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

input:

2
PX
.K

output:

2
1 1
DP

result:

ok 

Test #4:

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

input:

2
P.
K.

output:

1
1 1
D

result:

ok 

Test #5:

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

input:

2
P.
.K

output:

2
1 1
DP

result:

ok 

Test #6:

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

input:

2
PX
XK

output:

NIE

result:

ok NIE

Test #7:

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

input:

3
P.X
...
X.K

output:

4
1 1
DPDP

result:

ok 

Test #8:

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

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
1 5
PGGPPGGGLGGLLGLLDDLLG

result:

ok 

Test #9:

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

input:

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

output:

18
1 2
GPPDDPPDDDDPPPPDDL

result:

ok 

Test #10:

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

input:

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

output:

40
1 6
PGPGPGPGPGGLLDLDLDLDLDLDDDPPPPGPGPGPPDDL

result:

ok 

Test #11:

score: 0
Accepted
time: 200ms
memory: 44032kb

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 681
LLDDDDDLDDDLDDDDDDDDLDDLLDDDLDLLLLDDDDDDLLLLDDDDLLDLLLLDDLDDDLLLLLLLLLDDDDDDDDDDDDDDDDDDLDDLDLDDDDLLLLLLDDLLLDDLDDDDDLDLDDLDDDLDDDLDDDLLDLDLDDDDLDDDLLDDDLLDDLDLDDLLDDLLLLDLDLDDDDDDLDLDDLLDLLDLLDDLLDLDDDLDDDDDDLLLDDDDDLLLDDDDDDDDDDDDDDLDDLLLDLDDDDDDDLDDDLDDDDLDDDDDDDDDDDDLLLDDDDDDDDDDDDD...

result:

ok 

Test #12:

score: 0
Accepted
time: 187ms
memory: 44104kb

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
286 783
LLLLLLLGGGLLLDDDLDDDDDDDDDDDLDLLLDDDDLLDLLLLDLDLLDLDDDDDDDLLLLLDLLLLLDDLDLDDDDDDLDDDDDDDDDDDLDDLLDDDDDDLDDLLDLDDDLLDDLDDLLLDLLLDDLDDDDLDLDDDDLLLLLDLDDDDLLLLLLLDLLLDLDLLDLLDDDLDLDDDDLDDLDDLLDDDDDDDDDDLDDDLDLLLDDPDDDDDDDDLLDLDDDDDLDLLDDLDDDDLDDDDDLLDDDDDDDLDDDDDDDLLLDDDDLLDLLDDLDLDLDDDLLLD...

result:

ok 

Test #13:

score: 0
Accepted
time: 173ms
memory: 44088kb

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 415
LLDDDDDDDLDDPDPDDDDPDDPDDDDDPPPPDPPPDDDDPPPPPDPDPDPPPPPPPDPPPPPDPPPPPPDPPDPPPPPPPPPDDPPPPDDPPPPGPGGPGPPDPPDPPPPDPDDDDLDDDDDDDDDDDLDDPPDPDPDDPDDDDDPDPDPDDDDDDDPPDDLDDDDDDPPPDDDPDPPPPPPGPPDDDDDDDDDPDDDDDLDLDDDDDDPPDDDDPDDLLDDDDDDDDPDDDPPPDPPPDDDDPPDPPPPPPDPPPPPPPPPPPPPPPDDPPPPPPDPDDPPPPDP...

result:

ok 

Test #14:

score: 0
Accepted
time: 114ms
memory: 28380kb

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: 73ms
memory: 12612kb

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

input:

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

output:

12
1 1
DDDDDDPPPPPP

result:

ok 

Test #17:

score: 0
Accepted
time: 117ms
memory: 44128kb

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
2 6
DDDDDDLLLLLGGGGGGGGGGGGGGGLLDDDDDDLLGGGGGGGGGGGGGGGGGGLLLLLGGLLLLLLGGLLGGLLGGGPGGLLLLLLLLLGGLLLLLLLLLGGLLGGGLLLLGLLLGGGGGGGGGGLLLLLLGGLLLGGGLGGLLLLLGGLGGPGGPPGGGLLGGGGGGGGGGGLGGPGGPPGGGGGGGGGLLDDLLLLLLLLLGGPPGGGGGGGGGGGGGGGGGGGLGGLGGLGGPGGGGGGGGLLLGGGLLGGGLLLLLLLLLGGGGGGGGGGGGGGGGPGGPGGPGGL...

result:

ok 

Test #18:

score: 0
Accepted
time: 1116ms
memory: 47532kb

input:

999
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

270890
39 698
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...

result:

ok 

Test #19:

score: 0
Accepted
time: 105ms
memory: 55292kb

input:

999
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

253897
2 16
PGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGG...

result:

ok 

Test #20:

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

input:

2
KX
XP

output:

NIE

result:

ok NIE

Test #21:

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

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

input:

2
PK
..

output:

1
1 1
P

result:

ok 

Test #23:

score: 0
Accepted
time: 32ms
memory: 9600kb

input:

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

output:

167
38 39
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLGGGGGGGGGGGGGGG

result:

ok 

Test #24:

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

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 2
LLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPP

result:

ok 

Test #25:

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

input:

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

output:

4281
108 189
PPPPPPPPPDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...

result:

ok 

Test #26:

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

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
2 3
LGGGGGLLLLLLGGLLLDDLDDDPDDDDDPPPPPDPPPPPPPPGGGGGGGGGGGGGGGLLLLLLLLLLGLLLDDLLLLLDDDDDLLDDDDDDDDDDDDDPPPPPPPPPPPPPPPPPPPPPPDPPPGGGGGGGGGGGGGGPGGGGGLGGGGGGGLLLLLLLLLLLLLLLLLLDDLLLLLLLLLLDDDDDLLDDDPDDDDDDDLDDDPPDDDDDDDDDDDPPPPPPPPPPPPPPPPPPPPPPPPPGPPPPPDPPPPGGGGGGGGGLGGGGGGGGGGGGGGGPGGGGGLGGGLG...

result:

ok 

Test #27:

score: 0
Accepted
time: 233ms
memory: 45476kb

input:

1000
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

50730
3 302
DDDDDDDDDDDDDLLLLLLLDDDPPPPPPPPPPPPPPPPDDDDDDPPPPPPPPPPPPPPPPPPPPPPPPPGGGGPPPPPPPGGGGGPPPPPPPPPGGGGGGGGGGGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGGGGGGGGLLLDLLLLLLLLLLLLLLLLLLLLLLLLLDDDDDDDDLLLLLLLLLLLLLLLLLLDDDDDDDDDDDDDDDDDDDDDDDDDLLDDDPPPPPPPPPPDDDDDDDDDDDDDDDDDDDDDDDDDP...

result:

ok 

Subtask #2:

score: 20
Accepted

Test #28:

score: 20
Accepted
time: 1ms
memory: 8016kb

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

input:

2
PK
X#

output:

1
1 1
P

result:

ok 

Test #30:

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

input:

2
#K
P#

output:

2
1 1
GP

result:

ok 

Test #31:

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

input:

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

output:

285
22 26
DDDDDDDDLLDDPPDDDDDDDDDDDDDDDDLLGGGGGGGGGGGLLDDDDDDDDDDDLLLLLLLLLLGGGGGGGGLLDDDLLLLLLLLLLLDDDDDLLGGGGGGGGGGGGGPPPPPPPGGGGLLGGGGGGGGGGGLLLLLLLLDDDLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPDDDDDDDDDDDDDDDLLLLLLLLLLLLL

result:

ok 

Test #32:

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

input:

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

output:

64
11 27
DDDDPPGGGGGGGGGGGGGGGGGGLLLLLLLLLLGGLLLLLGGLLLGGPPGGGLLLLGLLLLLL

result:

ok 

Test #33:

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

input:

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

output:

18
9 1
DDDDDDDDPPPPPPPPPD

result:

ok 

Test #34:

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

input:

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

output:

70
5 1
PPPPPPPPPPGGLLLLLLLLLLGGPPPPPPPPPPGGLLLLLLLLLLGGPPPPPPPPPPGGLLLLLLLLLL

result:

ok 

Test #35:

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

input:

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

output:

8
5 1
LDDDPPPG

result:

ok 

Test #36:

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

input:

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

output:

NIE

result:

ok NIE

Test #37:

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

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
16 5
LDDLDDDDDDDDDDDDDDDDDDDDDDDDDDDDLDDDDLLLLLLLGLLGGGPGGGGGPGGGGPPGGGGGGGLLGGGLLGGLGGPPPPPPGGLLLLLLGGPGGGLLDLLDDLDDDDDDDDDLDDDDDDDDDLDDDDDDDDDLLLDLLLLLLLGLLGGGGGPGGGGPGGGGGGGGGGGGGGGGGGGGGLLGGLLLDDLLLDDDDDDDDLDDDDDDDDDDDDDDDDDDDDDDDDDD

result:

ok 

Test #38:

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

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

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

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
LLGLLDLLLLDDLLGLLLLLLLDLLGLLLLLLLLGLLGLLGLLLLGGGGGGGPPPPPPPPPPPPDPPPGGPGGPPPPPGPPDPPPPPPGGGGLLLLLLLLGLLLLLGLLLLGLLGLGLLLLGLLDLLLLLLLGGGGGPGPPPPPPPPGPPPPPPPPPPGPPPPPPPDPPPGGPPPPGGPGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL

result:

ok 

Test #41:

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

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
6 6
LLGGGGGGGLGGLLLLLLLLLLLLLLLLLGGGGLLGGGGGGGGGGGGGGLGGGGGGGLGLLGLLLLLLLLLLLL

result:

ok 

Test #42:

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

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

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
11 3
GGGGGLLGGGLGGGGGGGGGGGGGGGGGGGGGGGGPPPGGGPPPPPPPGGGGGGPPDDDDDDPDDPDDDDDDDDDDLLDDDDDDLDDDLLLDDPPPPPPDDLLLLLLDDPPPPDDDPPPPPPPGGGGGGGGGPGGGLGGGGGGGPGGPGGGGGGGGGPPGGLLLLLLGGPPPPPPPPPDDDDPPDDDLLDDPPPPPPDDLLLLLLDDPPDDDPPPPDDLLLLLLDDPPPPPPDDDDDDDDDDDLDDDPPPPGGGGGPPPPPPGGLLLLLLGGGGGGGPPPPPPGGLLLLLL...

result:

ok 

Test #44:

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

input:

2
K#
#P

output:

2
1 1
LG

result:

ok 

Test #45:

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

input:

2
XP
K#

output:

2
2 2
DL

result:

ok 

Test #46:

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

input:

2
K#
XP

output:

2
1 2
GL

result:

ok 

Test #47:

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

input:

2
K#
PX

output:

1
1 1
G

result:

ok 

Subtask #3:

score: 30
Accepted

Dependency #2:

100%
Accepted

Test #48:

score: 30
Accepted
time: 14ms
memory: 9596kb

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
79 95
DDDDDLLDDDDPDDDDPDPPDDDDDDDDDDDDDDDDDDDDDDDDDPDDDDDDDDDDPDDDDPPPPPPPPPPPDDPPDPPDDPDDPPPPPPPPDDDDPDPPDPPPDPDDDDPPPPPP

result:

ok 

Test #49:

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

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
GGLGGLGGGGLGGPGGGLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLGGGGGLGGPGGPGGPGGGGGGGGLGGGGLGGGGGPGPGPPD

result:

ok 

Test #50:

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

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
LLLDDLLLLLLDDDDLLLLGLLLDDDDDLLDLLLLLLLGLLDLLLLDLLLLLLDLLDLDDDPDDDDDLDDPDPDDDDLDDDDLDDDDDDLLDDLDLLLLLLLLLGLLDLDLLDDLLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDDLLDLLDDDLDDLDDDLLLLLDDLLLLDLDDDD

result:

ok 

Test #51:

score: 0
Accepted
time: 12ms
memory: 6932kb

input:

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

output:

184
94 195
GGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDDLDLLDDDDDPPG

result:

ok 

Test #52:

score: 0
Accepted
time: 44ms
memory: 10288kb

input:

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

output:

95
120 140
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP

result:

ok 

Test #53:

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

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 153
LGGGGGPPGGGPGGGGGLGLGGPGGGPGGGGGGGLLGGGGGGGLLLLDLLLGGGGGGLLGLLDDLLLGGLLLDLLLLLGGGGLGGGGGGGGGLGGGGLLLLGGGGLLLLGGGGGGGGLLLLDLLDLLLLLLDLLLDDLLDDLLGGLGGGGLLLLLLLDLLGGGGGGLLLLLLGGLLLGLLLLLGGGGGLGGGLGGPGGLGLLGLGLGGGGGGLLLLLGGGLLLLLLLLLLGLGLLLGLLGGGGGGLGGGLGGGGGGGGGPGPPPDPPPGGGGLGLLGGGGGLLLLLGL...

result:

ok 

Test #54:

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

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
183 105
PGGGPPPGGPPPGPPDPPPPPDPPPPGGPPPPDPPGPPGPPPPPPPPPGPPPPPPPPGGPPPPPPPPPGPPPPPPPPPDPDPPPPPPDPPPPPPPPGGGGGPGPPPPPPGPPDDPPDDDDDPPDDDDPPPDPPPPPDPPPPPPPDDPPPPPPPPPDPPPPPGPPPDPPDPPPPPPGGGPPPPPPPPGPPPGGPGPPPGPPPPGPPPPPPPPPGGGGGPPPPGPPGPPPPPPPGGGGGPGGGGLLLGGLLLGLGGGGLLLGLLLGGLGLLLLGLGGLGLLGLLLLGLL...

result:

ok 

Test #55:

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

input:

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

output:

1333
25 75
GGGGGLGGGGGGGPGGGGPPPGPGGGGGGPGGGGGGGGGGGGGGGGGGGLLGGGGGGGGPGGGGGGGGGPPGGGGGGGPPGGLGLLGGGGGGGGGLGGGGLGGGGLGGGGGGGGPGGGGPPGGGGGGPPGGGPGGGGGPPGGGPGGPGPPGPGPGGGGGGGGGGGGGGPGPGGGPPPGGGPPDPPDPPPPDDDDDDDDDDPDDPDDDDDDDDDDDDDDDDDPDDDDPDDDDDDDDDDPPDPPDDPPDDDPDDDDDDDDDDPDDDDPDDPDPDDDDDDDDDDDDDLDDDL...

result:

ok 

Test #56:

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

input:

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

output:

3203
60 44
PPGPPPGGGGLLLLLLLLDDLLLLDDDLLLDDDPPDPDPPPPPPPPPPPPDPPPPPGGGGGGGGGGGPGGGPGGLLGLGGGLLGLLGGGLLLGLLLLLGLLDLLLLLLLLLLLLLLLLLDDDDPDDDDDDDDDDDDDDDDDDDDDDDDPDDDDLDDDPPPPPDPPPPPPPDPPPPPPPPPPPPPPPPPPPPPDPPPPPPPPPPPPPPPGGGGPGGGGGLGGGGPGGGGGGGGGGGGGGGLGLGGGGGGGGGGGLLLGGGGGLGGGLLLDLLLLLLLLDLLLLLLLLLLL...

result:

ok 

Test #57:

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

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
166 189
GPPPPPPPGGGPGGGGPGGGGPGGGGPGGGGLLLLLLLLLLLLLLLLLLLGGLLLGGGGGGGGGGGGGGGLLLGGGGGLGGGGGGGGGPGGGGLGLLLGGGGGGGGGLGGGGGGGLLGGPPGGGGGGGGGGGGGGLGGGGGGGGGGGGGGGGGGLLLLGLLLLLLLLGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLGGGGLLLLLLGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLGLGGLLGGGGGGGLLLLLDLLLLLLLLLLLLLGLGGGGGGGGGLLLLGLL...

result:

ok 

Test #58:

score: 0
Accepted
time: 17ms
memory: 7600kb

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
179 178
LDLDLDLDLLLLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL...

result:

ok 

Test #59:

score: 0
Accepted
time: 12ms
memory: 11572kb

input:

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

output:

3398
82 107
LLDDDPPDDPPPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLDDDDDDDPPPDDDDDDPPPDDDDDDDDDDDDDLDDDLDDDDDDDDDDLLLDDDPPPDDDDDDDDDDDDDDDDDDDDDDDLDDDPDDDDDDDDDDLLLDDDDDDDDDDDDDDDDPPDDDDDDDDDDPDDDDDDDDDDDDDLLLLDDDLLDDDDDDDDDDDDDDDDDDDLLLGLLLLLLLLLGGGGGGGGPPGGGGGGGGPPPGGGGGGGGGGGGGGGGLGGLLLGGGGGGGGGGGG...

result:

ok 

Test #60:

score: 0
Accepted
time: 14ms
memory: 9236kb

input:

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

output:

497
38 18
PPPGGPGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPDPPPPDPPPPPPDDDDDDDPPPPPDPPPPPDDDDDPPPPPDDDDDPPDDPPDPDPDDDDDPPDDDDDDDP...

result:

ok 

Test #61:

score: 0
Accepted
time: 17ms
memory: 11236kb

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 133
LLLLLLLLLLLLLLLLLLGLLLLLLGGLLLLLLGGGGLLGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGGGGGGGGGGGGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPDDDDPPPPPPPPPPPPPPPPPPGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGGGPPGP...

result:

ok 

Test #62:

score: 0
Accepted
time: 15ms
memory: 9928kb

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 69
DDDDDDLLLDDLLDDDDDDDDDDDDLDDPPDDDDDDDDDDDDDDDDDDDDDDDDDDLDDDDDDLLLDDLDDLLDDPPPDDPPPPPDDPDDLDDDPDDPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPPDDDDLLLLDDPDDLLDDDDDDLDDDDLLDDDLLDDPPDDPPDDLLLDDPDDLDDPDDDDDDPDDDDDDDDLLLLLLDDDDLLLLDDDLLLLLLLLLLLLGGLLLGGLLLGGGGLLLGLLLDDDDDDLLDDDLLDLLLLGLLGLLDLL...

result:

ok 

Test #63:

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

input:

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

output:

2297
9 14
DDDPPPDDPPDDLLDDDDDDLLLLLLDDDPPDDDDPPDPPDPPPPDDDDDDDDPPPPPGGGGPGGPPPGGPPPGGGGPGGGGGLLGGLGGGGGGPGGLLGGGGPPGGPPGGLLLLGGGLLGGGGLLGGGLLLGGLLDLLLLLLGGGLLDLLGLLLLGGLLDLLLLDDLLDDPDDDDPDDLDDLDDLDDDDDDLLDLLDLLLLDDLLDDDDLLDDLLDDDDDDPPPPDDLLLLDDPDDPDDDDDDDDDDPPPDDPPPPPPPDDDDDDDDPPPPPPDDDDPPPDPPPPPPPP...

result:

ok 

Test #64:

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

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 128
LLGLLLLGGGLGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGLLGGGGGGGGGGGGGGGGGGGGLLGLLLLLLLLLLLLGGGLLLLLLLGGGGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGGGGGGGGGGGGGGGGGGGGPPGPGGPPPPPPPPPGG...

result:

ok 

Test #65:

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

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 23
DDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPPPPPPGPPDPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGPPDDD...

result:

ok 

Test #66:

score: 0
Accepted
time: 12ms
memory: 9580kb

input:

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

output:

8707
80 173
DPPPPPPPDDLLLLLLLLLLLLLLLLLLDDLDLLDLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLLLLLLGGLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLGGLLLDDLLLLLLLLLLLLLLLLLLDDLLLGGGGGGGGLLDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDD...

result:

ok 

Test #67:

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

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 172
LGGPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLDDLDDLLLLGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDLLGGGGGLLLDDDDDLLDLLLGLGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGLLD...

result:

ok 

Test #68:

score: 0
Accepted
time: 39ms
memory: 6792kb

input:

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

output:

398
199 1
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...

result:

ok 

Test #69:

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

input:

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

output:

7112
116 141
DDDDPPDPPPPDDPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLDDDLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLDDPPPPPPPPPPPPPPPPDDLLLLLLLLLLLLLLLLDDPPPPP...

result:

ok 

Test #70:

score: 0
Accepted
time: 17ms
memory: 10252kb

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 20
LDLLLLDLLLLDLLLLDLLLLDLLLLDLLLGGLGGLGGLGGLLLLLLLLLGGGGGGGLLGGGLLDDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDLDDDDDDLLLLLDDDDDDLLLLLLLLLLLDDDPPPPPPPPPPPDDDDPDDPPDDPPPPPPPPPPPPPPDDDDPPPPGPPPPPPPPPDPPPPPPPPPP...

result:

ok 

Test #71:

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

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
148 155
LLLDDLLLDLLLDLDLLLLGGLLGLGLGLLLLLGGLLGLLLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLLLLLLLLLGGGGGLGGGGGGLGGGGGGGGGLLLLLGGLLLGGGGLLLGGGGGGGGGGGGGGGGLGGLGGGGGGLGGGGGLLGLLLLLLGLLLLLLGLLLLGGLGGGGGGLLLLLGGLLLGGGGGGGLLLLLGGLGLLGLGGLLGGPGGGGPGGLGGGGGGLLLLGLLLLLLGGGLLLLGLLLGGGGGGGGLLLLLLLLLLGGGGGGLLLLLLLL...

result:

ok 

Test #72:

score: 0
Accepted
time: 14ms
memory: 8920kb

input:

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

output:

3496
176 158
DPPPPPPDPPDPDPPPPPPPDPPPPPGGPPPDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGG...

result:

ok 

Test #73:

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

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
5 4
PPPPPPPDDDPPPPPDDPDDDDDPPPPPPPPPPPPDPDDDDPPPPPPPPPPPPDPPPPPDDDPPPPPPGGGPPPDPDDLDDPPDDDDDDPDDPPPPPPDPPPPPPDDDDDDDDPPPDDDDDDPPPPDDDDDDDDDPDDDDPPPPPPPPDDDDDDLLDDDDDDPPDDPPPDPPDDDPPPPPPPPPPDDDDDPDPPDPPDPPPPPPPDDDDDPDPPDPPDDDPPPPDDDDPDDPPPPPDPDPDPPPDDDDDPPPPDDDDPPPPPDDDDDDDDDDDDDPPPPPDDDPDPPPPPPD...

result:

ok 

Test #74:

score: 0
Accepted
time: 19ms
memory: 10952kb

input:

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

output:

2682
139 8
PGGGGGGGGGGGGGGGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPGPGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD...

result:

ok 

Test #75:

score: 0
Accepted
time: 14ms
memory: 10360kb

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 95
LLGGGGGGGGGGLLLLLL

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: 285ms
memory: 44168kb

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
PGGPPPGPPPPPPPPPPGGPPGGGGGGGGPGGPPGGGPGGGGGGGGGGPPPGPPPGGPPPPPGPPPPPGGGGGGGGPGGGGGGGPGGGGGGPPPGGGPPPPGGGGPGGGPGGGGGGPGGGGGGPGGGGLGGPPPPPPGGGPGGGGGGPGGGGGGGPGGGGGGPGPGGGGGGPPGGPPGPPGGPPPPGGGGPGPGGLGGPPGGGGGGGPGPGPGPGGGGPGPGPGGGGPPGGPPPPPPGPGPGGGGGGPPPPPGPPGGGGGGPGGGPPPGGPGGGGLGGGGGGGGGGPP...

result:

ok 

Test #77:

score: 0
Accepted
time: 299ms
memory: 44084kb

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
195 740
PPPPGPPDPPDDDPDDPPPDPDDDPPDDPDDDDDDDLLDDPDPDPDPPDDDDPPDDDDDDDDDDLDDDLDDDPDDPDDDPDDDDDDDDDDDDDDDDDDDLDDDDDLDDDDPDDDDDDPDDPDPDDDLLLDDDDDDDDDDLDDLDLDLLLLDDPPDDDDDPDDDDPPPPDDDDDDDDDDDDDDDDLLLDLDDDDDDDPDDDDDDPDDDPDDDDPDDLDDDDDDDDDDDPDDDLDLDDDPPDPDPPPDPDDDDDLLDLLDLLLDDDDDDDDDLDLDDDDPDPDDDDDDDD...

result:

ok 

Test #78:

score: 0
Accepted
time: 266ms
memory: 44012kb

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
DLLLLGLLLDLLLLDDDLDDDDDDDDDDDLLLDDLLLLGLGGGLGGGGGLGGLLLLLLLGGLGGLGLLLGGLLGLLLLDLLLDLLLLLLDLLLLLLGGLGGGLGGGGGGLLGGLGLLDLDDDDDDLLLLDDDDPDDLDDLDDDDDDDLLLLDDLDDPPDDDDDDDDDDDLDDDLLDDLLGLLLLLGGLLLGLLGGGGGLGGPGGPGGGLLLLLLLLLLGLGLLGLLGLGGLLGGLGLGGLLGLLLLLLGGGLLLLLLLLLLDLLLLLGLLLLGGLGLLGLLDDDLDDL...

result:

ok 

Test #79:

score: 0
Accepted
time: 718ms
memory: 28468kb

input:

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

output:

2713
866 866
PGPPPPGGPPPDDPPPDPPDDDPDDDDDPDDPDDDLDDDDLDDDDDDDDDLLDDDDDLLDDDDDLLLLLDDPDDLDLLLLGLLLLLLLLLLLLLLLDDDLDLDDDDLLLLGGGGGLLLDDLLLGLGLLDDLDLLLLLDLLLGLLLLLLDLLLLLLLDLLDDDDLLDDDLLLLDDDLLGLLDDLLLLLLLLLLLLLDDDPDDDPDDDLDDLLDLLLLLLLDLLDLLLLGGLLDLDDPDDDDDDDDDLLDLLDLLLLLLLLLLLLLGLGLLGGLLLLLLLLGLLDLLGL...

result:

ok 

Test #80:

score: 0
Accepted
time: 428ms
memory: 44176kb

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 602
DDLDDLLLLLLLDLLDLLLDLDLDLLDLDDLLLDLLLLLLLLDDDDDDLLLDDDDDDLLDLDLLLLLDLLLLLDDLLDDDDDDDDDDDLLLLLDLLLGGGLLDLLGLLDLLDDDDDDDLDDLDDDLDLDDDDDDDLDDDDDPDDDLDDDPDDLLDDDLLLLLDDDDDLLLDDDDDDLLLLLLGGLGLLDLLLLLLDLLGGLGLLLLGLLLLLDDLLLLDLLLDDLLLDDDLLDDDLLLDDLLLLLDLLLLLLLLDDDDLDDLLLLDLLLGLLDLLLDDDLLLDDDDL...

result:

ok 

Test #81:

score: 0
Accepted
time: 224ms
memory: 44032kb

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 692
DDDLLLDLLLLLLLGLLLLLLLLGLLLLLLGLLGGGGLGLGLLGGGLGLGGGLGGGGGGLLGLLGGGGGGLLLLLLLLDLLDLLLLLLLLLLLLLLLLLLLLLLLDLDDLLLGLLLLLLLLLLLGLLGLLLLGLGGPGGGGGGLLGGGGGGGGGGGGLLGGLLLGLLLLGLLGGGLLLGLLLGLLGGGLGGLGGGGLLGLGLLGLLGLGGGLGLLDLLLGLGGGGLLGGGGPPGGGPGGGGGGGLGGGLGGGLLLGGGGGGLGGLLGGGLLDLLLLGLLLGLGLLLGG...

result:

ok 

Test #82:

score: 0
Accepted
time: 238ms
memory: 44168kb

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
316 609
DLLLLLLLGLLGLGGLLLLGLLLLLLDLLLLLDLLDDDLLLLDDDLLLDLDDDLLLLLDDLLLLLLDLDLDDLLLLLLDDDDLDDDLDLLLLDLDLLDLDLLDDDDDDDDDDDDDLLLDLLLLLLLLDDLLDLDLLDDDDLLDLDLDDLLLLDDLLLLLLLLLGLGLLLLLLLLLLDLDLLLLLGGGLLDLDDLLLLDDDLDDDDDDLLLLLLLLLLLLLLLLLDDDDLLLLLLLLDDLLLDLLLLGLLDLDLDLDLDDLDDDLLDDLDLLGLLDLLLLLLLDLLLL...

result:

ok 

Test #83:

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

input:

1000
PXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

1001
2 1
DPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...

result:

ok 

Test #84:

score: 0
Accepted
time: 170ms
memory: 27824kb

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
946 16
PPGPGPGGPGPGPPPGGGGGGGGGGPPPPGGGGGGGGGPPGGGPGGPPPPPPPPPPPPPPGPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPGPPPGGGGGGGGGGGGGPGPPPPPPPGGGPPPPPPPPGGPPPGGGGGGGGGGGGGGGPPPPGGPPPPPPPPPPPPPGPPPPPPPPPPPPPPPPPPGGPPPGGGGGGGGGGGPPPPGPPGGPPGGPPPPPPPPGGPPPGGGGGGGGGGGGGGGGGPPPPPPPPPPPPPPGGG...

result:

ok 

Test #85:

score: 0
Accepted
time: 344ms
memory: 44012kb

input:

957
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

34718
321 830
PDDDDDDDLDDDDDDLLDDDDDDDDDDDDLDDLDDDDDDDDDLLDDDDDDDPDDDDDDDDDDDDDDDDLDDDDDDDDDDDDDDPDDDDDPDDDDDDDDPDDLDDPDDDPDDDPPDDDDDDDDDDDDDLDDPDDDDDDDLDDLDDDDDDDDDLLDDPDDDDDDPDDDDDDPDDDPDDDDDDDDDDDLLDDDDDDDDDDDDDDDDDDDDDLDDDDLDDDDDDDDLDDDDDLLLDDDDDDDDDDDDDDDDDDDDDDDDDLDDDDDDDPDDDDDPDDDDDDDDDPDPDDD...

result:

ok 

Test #86:

score: 0
Accepted
time: 696ms
memory: 44356kb

input:

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

output:

49339
615 615
DDDLLLLLLLLLLLLLLLLLDLLLLDDPDDPPPPPPPDDDDDDPPPPPPPPPPPPGPPPPPPPPPPPPGGGGGGGGGGGGGGGGGGGGGGGGPGGGLLLGGLLLLLLLLLLLGLLLLLLGLLGGLLLDDDDLLLLLLLLLLLLLLLLLLLDDLLLLLDDDPDDDDDDDDDDLDDDDDDDDDDDDDDDDDDDDDDDDDLLDDDPPPPPPPDDDPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPDPPPPPPPPPPPPPPPPPPDPPPPPPPPGGGGGPGGGL...

result:

ok 

Test #87:

score: 0
Accepted
time: 340ms
memory: 12480kb

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: 559ms
memory: 13488kb

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: 515ms
memory: 43412kb

input:

961
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

31320
946 17
LLLLGGLLLLLLLLLLGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL...

result:

ok 

Test #90:

score: 0
Accepted
time: 630ms
memory: 44112kb

input:

961
#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

34666
922 636
DPPDDDPPDDDDPPPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLDDDPPPPPDDDDDDPPPPDDDDDDLDDLLLLLLDDDDDDDDLLDDPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLDDDDDDDLLLLLLDDLDDDDDDDDPPPDD...

result:

ok 

Test #91:

score: 0
Accepted
time: 386ms
memory: 44132kb

input:

961
.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

35766
881 109
GGPGGGGGGGGGGGGPGGPPPGGGGGGGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLGGGGGGGPPPGGPPPGGGGPGGGGGGGGGGGGLLLLGGLGGGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLGGGGGLGGGGLLLLGGPGGGGGGLGGPGGGGGGGGGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLGGGPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPGGGGGGGPPP...

result:

ok 

Test #92:

score: 0
Accepted
time: 337ms
memory: 42708kb

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
83 42
PDDDDDPPDDDPPDDDPPPPPPPPDDDDDPPDDDPPDDDDDDDPPPPDDDPPPPDDDPPDPPPPPPPPPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPPPDDPPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPDDDDDDDDDPPPPPPDPPPPDPPPPPDPPPPPPDPPPPGPPDPPPPDDDDDDDDDDDDDPPPPPPPPDDPDDPPDDPPPPPPDDDDP...

result:

ok 

Test #93:

score: 0
Accepted
time: 656ms
memory: 49136kb

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
LLLLLLLLLLLLLLLLLLLLLLLLLLLGGGGGGGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDLLGLLLGLLLLLLLLLLLLLLLLLLLGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGLLDDDDDDDD...

result:

ok 

Test #94:

score: 0
Accepted
time: 1978ms
memory: 50040kb

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
LDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLDLLLLGLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG...

result:

ok 

Test #95:

score: 0
Accepted
time: 290ms
memory: 51112kb

input:

975
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

227680
257 709
PPPPPPPPPPPPPPPPPPPPPPPPPPPPDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGG...

result:

ok 

Test #96:

score: 0
Accepted
time: 376ms
memory: 43740kb

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
579 69
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDLLGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDL...

result:

ok 

Test #97:

score: 0
Accepted
time: 139ms
memory: 52268kb

input:

961
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

204727
510 1
GPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGGGGLLLLLLLLLLLLLLL...

result:

ok 

Test #98:

score: 0
Accepted
time: 383ms
memory: 46372kb

input:

961
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

97435
329 624
PPPPPPPPPPPPPPPPPGGPPGPPPGGGGGGGGGGGGGPGGLLGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDLDLDDDDDDDDDDDDLDDDDDDDDLDDPDDPDDDDDDDDDPPDDPPDDPDPPPPPPPPPPPPDPPPPPPPPDPPPPPPPPPDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDDDDDDDDDDDDPPGGGGGGGGGGGGGGGGGGGGGGGGGGGGPPDDDDDDDDDDDDDDDDDD...

result:

ok 

Test #99:

score: 0
Accepted
time: 278ms
memory: 42880kb

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
LLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPGGGPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLGGPPPPPPPPPPPPPPPPPPPPPPPPPPPPGGLLLLL...

result:

ok 

Test #100:

score: 0
Accepted
time: 1320ms
memory: 44156kb

input:

999
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...

output:

5664
519 856
PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP...

result:

ok 

Extra Test:

score: 0
Extra Test Passed