QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#170610#5473. Move One CoinPhantomThreshold#AC ✓1012ms49592kbC++204.1kb2023-09-09 15:36:512023-09-09 15:37:51

Judging History

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

  • [2023-09-09 15:37:51]
  • 评测
  • 测评结果:AC
  • 用时:1012ms
  • 内存:49592kb
  • [2023-09-09 15:36:51]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

const int maxn=1000;


typedef long long ll;
const ll bx1=17;
const ll by1=19;
const ll mod1=993244853;
const ll bx2=107;
const ll by2=109;
const ll mod2=1000000009;
ll ksm(ll a,ll x,ll mod){
	ll ret=1;
	for (;x;x>>=1,a=a*a%mod) if (x&1) ret=ret*a%mod;
	return ret;
}
ll inv(ll a,ll mod){return ksm(a,mod-2,mod);}

void pre(ll x,ll mod,ll pw[],ll ipw[]){
	pw[0]=1;
	for (int i=1;i<=maxn;i++) pw[i]=pw[i-1]*x%mod;
	ipw[maxn]=inv(pw[maxn],mod);
	for (int i=maxn-1;i>=0;i--) ipw[i]=ipw[i+1]*x%mod;
}
ll pwx1[maxn+50];
ll pwy1[maxn+50];
ll pwx2[maxn+50];
ll pwy2[maxn+50];
ll ipwx1[maxn+50];
ll ipwy1[maxn+50];
ll ipwx2[maxn+50];
ll ipwy2[maxn+50];
void prepare(){
	pre(bx1,mod1,pwx1,ipwx1);
	pre(by1,mod1,pwy1,ipwy1);
	pre(bx2,mod2,pwx2,ipwx2);
	pre(by2,mod2,pwy2,ipwy2);
}

void add(pair<ll,ll> &h,ll i,ll j){
	h.first =(h.first +pwx1[i]*pwy1[j])%mod1;
	h.second=(h.second+pwx2[i]*pwy2[j])%mod2;
}
void sub(pair<ll,ll> &h,ll i,ll j){
	h.first =(h.first -pwx1[i]*pwy1[j])%mod1;
	h.second=(h.second-pwx2[i]*pwy2[j])%mod2;
	if (h.first <0) h.first +=mod1;
	if (h.second<0) h.second+=mod2;
}
void shl(pair<ll,ll> &h,ll i,ll j){
	h.first =h.first *ipwx1[i]%mod1*ipwy1[j]%mod1;
	h.second=h.second*ipwx2[i]%mod2*ipwy2[j]%mod2;
}

ll getid(const pair<ll,ll> &h){
	return (h.first<<32)|(h.second);	
}

int h,w;
int a[maxn+5][maxn+5];
int H,W;
int b[maxn+5][maxn+5];



void gao(){
	/*
	cerr << "------------" << endl;
	cerr << h << " " << w << endl;
	for (int i=1;i<=h;i++){
		for (int j=1;j<=w;j++){
			cerr << a[i][j];
		}
		cerr << endl;
	}
	cerr << "------------" << endl;
	cerr << H << " " << W << endl;
	for (int i=1;i<=H;i++){
		for (int j=1;j<=W;j++){
			cerr << b[i][j];
		}
		cerr << endl;
	}
	*/
	unordered_map<ll,pair<ll,ll>> dict;
	{
		pair<ll,ll> hv(0LL,0LL);
		set<pair<int,int>> s1,s2;
		for (int i=1;i<=H;i++){
			for (int j=1;j<=W;j++){
				if (b[i][j]==0) continue;
				add(hv,i,j);
				s1.emplace(i,j);
				s2.emplace(j,i);
			}
		}
		for (int i=1;i<=H;i++){
			for (int j=1;j<=W;j++){
				if (b[i][j]==0) continue;
				s1.erase(make_pair(i,j));
				s2.erase(make_pair(j,i));
				ll dx=s1.begin()->first;
				ll dy=s2.begin()->first;
				
				pair<ll,ll> tmp=hv;
				sub(tmp,i,j);
				shl(tmp,dx,dy);
				dict[getid(tmp)]=make_pair(i-dx,j-dy);
				
				s1.emplace(i,j);
				s2.emplace(j,i);
			}
		}
	}
	{
		pair<ll,ll> hv(0LL,0LL);
		set<pair<int,int>> s1,s2;
		for (int i=1;i<=h;i++){
			for (int j=1;j<=w;j++){
				if (a[i][j]==0) continue;
				add(hv,i,j);
				s1.emplace(i,j);
				s2.emplace(j,i);
			}
		}
		for (int i=1;i<=h;i++){
			for (int j=1;j<=w;j++){
				if (a[i][j]==0) continue;
				s1.erase(make_pair(i,j));
				s2.erase(make_pair(j,i));
				ll dx=s1.begin()->first;
				ll dy=s2.begin()->first;
				
				pair<ll,ll> tmp=hv;
				sub(tmp,i,j);
				shl(tmp,dx,dy);
				
				s1.emplace(i,j);
				s2.emplace(j,i);
				
				ll id=getid(tmp);
				if (dict.count(id)==0) continue;
				auto tt=dict[id];
				ll dirx=tt.first;
				ll diry=tt.second;
				if (i==dx+dirx && j==dy+diry) continue;
				cout << j-1 << " " << i-1 << "\n";
				cout << dy+diry-1 << " " << dx+dirx-1 << "\n";
				exit(0);
			}
		}
	}
}

string str;
int tmp[maxn+5][maxn+5];

int main(){
	prepare();
	int cnt=0,posx=0,posy=0;
	cin >> h >> w;
	for (int i=1;i<=h;i++){
		cin >> str;
		for (int j=1;j<=w;j++){
			a[i][j]=(str[j-1]=='o');
			if (a[i][j]){
				cnt++;
				posx=i;
				posy=j;	
			}
		}
	}
	cin >> H >> W;
	for (int i=1;i<=H;i++){
		cin >> str;
		for (int j=1;j<=W;j++) b[i][j]=(str[j-1]=='o');	
	}
	
	if (cnt==1){
		cout << posy-1 << " " << posx-1 << "\n";
		cout << posy << " " << posx << "\n";
		return 0;	
	}
	
	for (int DIR=0;DIR<4;DIR++){
	//	if (DIR==1){
			gao();
	//	}
		//rotate
		for (int i=1;i<=H;i++){
			for (int j=1;j<=W;j++){
				tmp[W-j+1][i]=b[i][j];
				b[i][j]=0;
			}
		}
		swap(W,H);
		for (int i=1;i<=H;i++){
			for (int j=1;j<=W;j++){
				b[i][j]=tmp[i][j];
			}
		}
	}
	return 0;	
}

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 7588kb

input:

2 3
xox
ooo
4 2
ox
ox
ox
ox

output:

1 0
3 1

result:

ok OK! rot=1

Test #2:

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

input:

3 3
xox
oxo
xox
4 4
oxxx
xxox
xoxo
xxxx

output:

1 2
-1 -1

result:

ok OK! rot=0

Test #3:

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

input:

500 500
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

498 498
0 0

result:

ok OK! rot=0

Test #4:

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

input:

500 500
oxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

0 0
498 498

result:

ok OK! rot=0

Test #5:

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

input:

500 500
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

497 1
0 499

result:

ok OK! rot=0

Test #6:

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

input:

500 500
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

0 499
497 1

result:

ok OK! rot=0

Test #7:

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

input:

500 500
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

0 498
-498 996

result:

ok OK! rot=3

Test #8:

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

input:

500 500
oxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

0 0
498 498

result:

ok OK! rot=1

Test #9:

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

input:

500 500
xooxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

1 0
-497 -498

result:

ok OK! rot=0

Test #10:

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

input:

500 500
oxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

0 0
498 498

result:

ok OK! rot=0

Test #11:

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

input:

500 500
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

498 1
0 499

result:

ok OK! rot=3

Test #12:

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

input:

500 500
oxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

0 0
498 498

result:

ok OK! rot=1

Test #13:

score: 0
Accepted
time: 587ms
memory: 49592kb

input:

500 500
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo...

output:

70 419
483 173

result:

ok OK! rot=0

Test #14:

score: 0
Accepted
time: 113ms
memory: 25820kb

input:

302 302
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

256 0
0 180

result:

ok OK! rot=0

Test #15:

score: 0
Accepted
time: 709ms
memory: 27876kb

input:

302 302
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxoxxxx...

output:

287 0
0 63

result:

ok OK! rot=1

Test #16:

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

input:

500 500
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxoxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

250 0
250 500

result:

ok OK! rot=0

Test #17:

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

input:

499 499
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

498 0
249 249

result:

ok OK! rot=3

Test #18:

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

input:

3 3
oxo
xox
oxo
3 4
oxox
xxxo
oxox

output:

1 1
3 1

result:

ok OK! rot=0

Test #19:

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

input:

3 3
oxo
xox
oxo
4 3
xox
oxo
xxx
oxo

output:

1 1
1 -1

result:

ok OK! rot=0

Test #20:

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

input:

500 500
oooxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

499 499
-497 -498

result:

ok OK! rot=0

Test #21:

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

input:

500 500
oxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

0 0
996 997

result:

ok OK! rot=0

Test #22:

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

input:

500 500
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

0 499
976 -477

result:

ok OK! rot=0

Test #23:

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

input:

1 2
oo
1 3
oxo

output:

0 0
3 0

result:

ok OK! rot=0

Test #24:

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

input:

1 2
oo
2 2
ox
xo

output:

0 0
2 1

result:

ok OK! rot=0

Test #25:

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

input:

10 10
oooxxxxoxx
xoxoxxxxxx
xooxxooxoo
ooxoxoxxoo
oooooxxoxx
xxxoxxoxox
oxoxxxxxox
xoxoxoxxoo
xooxxxxoxx
xxxxxxxoxx
10 10
xooxxxxoxx
xoxoxxxxxx
xooxxooxoo
ooxoxoxxoo
oooooxxoxx
xxxoxxoxox
oxooxxxxox
xoxoxoxxoo
xooxxxxoxx
xxxxxxxoxx

output:

0 0
3 6

result:

ok OK! rot=0

Test #26:

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

input:

11 9
xoxxoxoox
xxxxxxoxx
xoxoxxoxx
oxoooxooo
oxxxxxxxx
xxoxoxoxx
xxooxxxxo
oxooxooox
xxoxxxxxx
oxxoxxxox
xxxxxooxx
9 11
xoxoxxooxxx
xxxxxxxxoxo
xxooooxoxxx
xoxooxxooxx
xxxxooxoxxx
oxxoxxxxxxx
oxxoxoxoooo
xoxoxxxoxxo
xxxxoxxoxxx

output:

4 0
4 6

result:

ok OK! rot=3

Test #27:

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

input:

8 13
xxxxoxxxxxxxx
oxxxoxxxxxxxo
oxxxoxxxxxxxo
oxoxxxxxoxxxx
xoxxxxooxxxxx
xoxxoooxxxxxx
xoxxxxoxxoxxo
xoxxxxoxxxxox
8 13
xxxxxooxxxxox
oxxoxxoxxxxox
xxxxxxoooxxox
xxxxxooxxxxox
xxxxoxxxxxoxo
oxxxxxxxoxxxo
oxxxxxxxoxxxo
xxxxxxxxoxxxx

output:

11 7
7 7

result:

ok OK! rot=2

Test #28:

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

input:

7 16
xoxoxoxooxoxoxoo
xxxxoxxxoxxooxxx
xooxoxxooxxxoxox
oxxoxxxxxxoooxxx
xxxxoxxoxxxxxoxx
xxoxxxxoxoxoxxxx
xoooooxooxoxoxxx
7 16
xxxoooxxoxooooox
xxxxoxoxoxxxxoxx
xxoxxxxxoxxoxxxx
xxxoooxxxxxxoxxo
xoxoxxxooxxoxoox
xxxooxxoxxxoxxxx
ooxoxoxooxoxoxox

output:

8 6
11 6

result:

ok OK! rot=2

Test #29:

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

input:

14 7
xxxxxox
oxooxxx
xxooxox
xxxooxx
oxxoxxx
xooxxox
xxxoxxx
oxxoxxx
oooxxox
xoxoxxx
xxxoxox
ooxxxxx
xxooxox
ooxxxxo
14 6
oxxxoo
oxooxx
xxxxoo
oxoxxx
xxoxox
oxxooo
xxoxxo
xxoxxx
oxxoox
xxoxxo
xooxxx
oxooxx
xxooxo
oxxxxx

output:

6 13
5 13

result:

ok OK! rot=2

Test #30:

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

input:

4 10
oooxxoxxox
xoxxxoxxxo
oxxxxxxxxx
oxxoxxxxox
12 4
xxxo
xxxx
ooxx
xxoo
xxxo
oxxx
xxxx
xxoo
xxxx
xxxx
oxxo
xxox

output:

0 0
-2 0

result:

ok OK! rot=3

Test #31:

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

input:

9 9
xxxoxxoxo
xxxxoxxxx
xoxxxoxox
xxooxxxxo
xxxxoxoxx
oooxooxox
xxxxxxxox
oxxxoxxox
ooooxxxxo
10 9
oxxxxoooo
xoxxoxxxo
xoxxxxxxx
xoxooxooo
xxoxoxxxx
oxxxxooxx
xoxoxxxox
xxxxoxxxx
oxoxxxxxx
xxxxxoxxx

output:

3 0
3 -1

result:

ok OK! rot=2

Test #32:

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

input:

12 9
xxoxoxxxx
xxxxxxxxx
xoxxxxxxx
xxoxxxxxx
ooxxxoxxx
xxxxoxoxo
xxxoxxxxx
xxxxxoxxx
xooxxxxxx
oxxxooxxx
xoxoxxxxx
xoxxoxoxx
8 12
xxxxxxoxxxxx
xxxxxoxxxxxo
xxxxoxxoxoxx
oxxxxoxxxoxo
xxxxxxoxxxox
oxxoxxxxoxxx
xxoxoxxxoxoo
xxxxoxxxxoxx

output:

8 5
7 6

result:

ok OK! rot=1

Test #33:

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

input:

50 50
oxxooxoooxoooxxoooxxxooxxooxxooxooxooooxoxxxooxxxx
xxoooooxooxxxxxooxxxxxoxooooxooxxxoxxxxoxxoooooxox
ooooooooxxxooxxooxoooxoxoxoooxxxxoxoxoxooooooxooxo
xooooxoxxxoxoxxxxoxoxoxxoxooxxooxxoooxooxxoxxxoxox
xoxxxxoxxxxoxxxooooooxoooxoxoxxoooooooxoooooooxoxx
xoxoxooxxxoxooxoxxooxxxxxxxxxxoxooxxxoo...

output:

17 25
40 36

result:

ok OK! rot=0

Test #34:

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

input:

50 50
xxxoxoxxxooxxoxooxoooxoxxooooxoxooooxxoxxxxxxoxooo
xoxxxoxxoxxxoxxxoxoooxxxoxxxoxooxoxoxooooxooooxxoo
oxoxxoooxxooooxxxxooxxoxxoooxxxoxoxooxxoxoxxoxxxxx
xxoxxoooxxoooxxxxxxooxxxoooooxooxoxooxxooooxxxoxxo
ooxxoxoxoooxxoooxoxooxxoxoxxxoxxoxooxxxxooooxooxox
xoxxxooooxooxxxoxxxxxooxxxoooooxxoxooxx...

output:

8 9
28 18

result:

ok OK! rot=1

Test #35:

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

input:

50 50
ooxooxxxoxoooooxoxoxooxoooooooxxoooxoxoooooxxxoxoo
xoxoxxxoxxxooxoooxxoooooooooxoxooooxoooooooxxxoxoo
xxxxxooxooxxxxxxxxxooooxooxxxxoxxoxxoxoooxxxxxxoox
ooxoxoxxxxxxxoxoxoxooxxoooxooxxooxooxxoxoxxooooxoo
oxoxoxxxxooxoxoxoxxoooooxxooxoxxoxooooxoxxxooooxox
oxxxoxxxxxoooxxxoooxxxxxoooooxoxooxooox...

output:

39 4
23 13

result:

ok OK! rot=0

Test #36:

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

input:

50 50
xxoxxoxoxooooxooooxoxxooxooxoooxoxoooxoxooxxoxxxxx
xxooxooooxooxooooooooxoxxxxxooooxooooooxxxoooxxoxo
xxxoooxxxooxxxoxoooxoxoooooxooxoxxxxxoooxxoxoxxoox
ooxxxooxxoxxxoooxxxoxoxxxooooxoxoooxoxoooxxoxooooo
oxoxoooooxxxooxxoxooxoooooxoxxxooxoxoxxxoxxxxooxxx
ooooooxxxxoooxxxoxoxooxoxoxxoxxoooxxxxx...

output:

20 49
47 45

result:

ok OK! rot=2

Test #37:

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

input:

50 50
ooooxxoxxxxxoooxoooooxoxoxxxxxooxxooxoxooxxoooxoxx
xoooxoxoxooxxoxxxooooooxxoxxxoxxxooxoxoxoxooooxxxo
xoxoxooxoxxooxoxoooxxooxxoxooxoxoxxooxoxooooxoxooo
oooooooooxxoxxooxoooooxxoooxooxooxxoxooxxooxoxxooo
xxxoxoxxoxooxoooxooxxoxoxxooxxoxoxoxxoxoxoxoxxooox
xooxxooxxxoxxoxoxoxxxxxoxooxxxoooxxoxxx...

output:

49 32
35 22

result:

ok OK! rot=0

Test #38:

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

input:

50 50
oxxxxxooxxoxxxxoxoxooxxooooxxoxooxoxoxooxooxxoxxox
xxooxooxoxxoxxoxxoxxxoooxoxxoxoxooxoxxxoxxxoxooxxx
oooxxxxoxxxoxxoxxxxooxxoooxoxoxoxooxoxxxoxxxoxooxo
oxooxxxoxooxooooxoxxxxoxxooxoxoxxxooooxooxxoxooxxo
oxxoxooxooxxxxxxoooxxxxooxoooxxxxoxxoxxooxoxxooxxo
xooooooooxxoxoxoooxooxoxxoxxxxxxoxoooxo...

output:

49 23
40 40

result:

ok OK! rot=2

Test #39:

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

input:

50 50
oxoooxxoooxoxoxoxxxooxxxoxxxoxoxoxooxxxxoxoxooooxx
ooxoooxoxxxoxoooxxoxxxoxooxoxoxxoxxoooxxxxoxooxoox
xxoxxoooxoooooxoxxooxoxxooxxxxoxooxxxxxooxoxxxxxxo
ooxxoxooxxxoxoxooxoxoxxoooxoxxoxoxooooxxxxooooxoxo
ooxooxxxxoooooooxxoxxoooxooxoooxxoxxooxxxoooxoxoox
xoooooooxxoxoxoooxxxooxoxxxooxxxxxoxoxo...

output:

31 23
52 11

result:

ok OK! rot=3

Test #40:

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

input:

50 50
ooxxoxoxxoxoxoxooxoxxxoxoxxooooxxooxxooooxxxxxxoox
oxxxxooooxxxoxxxxoxxooxxoxooxooxxxooxxxxooooxxxxxx
oooxoxoxoxoooxoooxxxoooxxooooxxxoxoxoooxoxxoxxoooo
ooxxxoxxoxxoxooxoxoxxoxxxoooxxxxxxxooxxxxxoxxxxoxx
oxxoxxxooxxoxoxxxxxxoxoxxxoxxxxooxxxxooxxoxxxxxoxo
xooooxoooooxxooxoxxxoxooxxxoxooxxxoxxxx...

output:

35 9
52 3

result:

ok OK! rot=1

Test #41:

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

input:

50 50
xooxxoxxoooxxxxoxxxoooxoxoooxoxxxooxxxxooxxxxoooox
ooxxoxoxxxxxxxoooooooooxooooxoooxoxoxoxxooxooxxoox
xxooxxoxoxxooooxxxxxxxxoxxxxoxooxoxxxxoxxooxxxooxx
xxooooxxxxoxxoxxooxoxoooxoxxoxoxxxxoxooxxxxxxoxoox
xoooxoxxoxooooxooxoxxxooxxxxxxooooooxxxooooxxxxoxo
ooxxoxxxxxooxooxxoxoxooxxxoooxoxoxooxox...

output:

4 22
43 -3

result:

ok OK! rot=1

Test #42:

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

input:

50 50
oooooooxooxxoxxoxxxoxxoxooooxoxoxxxxoooxoxoxxooxxx
oooxoxooxxxoooooxoooxoxxoxxxoxoxxxoooxoxoxxoooxooo
oxxxxxoxxoxoxxxoxoxxooxoxxxxxooxxxxoxoxxoooxoxxxox
ooxoxxxxoxooxoxxooxooooooxoooxooooxxooooxxxxxoooxx
xxxxxxxxxxoooooooxooxooxooxooooxxxooooooxoxxoxoxox
xxoxoxxooxooxxxooxoxoxxoxoxxoxoxooxooxo...

output:

0 12
52 18

result:

ok OK! rot=2

Test #43:

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

input:

50 50
oxxoxxxoxxxooxooxxxxoxxooxxxoxoxxooooxxxoxxxoxooox
xxoxoxooooxoxxooxooooooxooooxoooxoxoxxoxxoxoooxooo
xxoooxoxoxooxxoxxoxxxxxoooxxxoxxxoooxoxoooxxxooxxo
ooxooxxooxxxooxoooooxxxxxoxxoooooxoxooooooooxxxoxx
xoxoxoxxxxxoxoxoxxooxxxooxxxoxooooxxoxxoooooxooxoo
xooxxxxxoxxxxxxxxxoxooxooxoooxxoxoooooo...

output:

20 49
52 -2

result:

ok OK! rot=0

Test #44:

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

input:

50 50
xooxxooxxoxoxxoxoxxooxxxxoxoxooxoooooooxxooxxooxoo
oooxxoxoxoxooxxooxooooxooxooooxxxxoooxooxxooxoooox
oxxxoxxxxoxxoxxoxxoxxxxxoxxooxoooxoooxxxoxoxoooxoo
ooxooxoxoxxxooooooxoooooxoxooxooxxxxxxxoxxxxxoxooo
oxxooxxxxooxxxxxoxxoooxxxxoxxxxxxxxooxoxxoxooxoxxo
xooxxooxoooxxooxoxoxxxxxxxxxxxxooooooox...

output:

22 49
10 -3

result:

ok OK! rot=1

Test #45:

score: 0
Accepted
time: 256ms
memory: 18464kb

input:

250 250
oxxoxxxxxxxxoxoooxxxxoooxoxxxoxxoxoxxoxoooxxxxoxxoooooxoooxxoooxxoxxoooxxooxxoxoooooooxoxxooxoxooooxooooxooxxxoooooxoxxxxxooxxoooxooxoxoooxxxoooxxxooooxxoxooxxoxxooxxxxoooxxooxxooooxxxxxxooxxxooooxoooxoxxoxoxxoxxxxoxoooxxoooxoxooooxoxxoxxxoooxoxooooo
xoooooxoxxooxoooooxoxoooooooxxooxoooxxoxo...

output:

178 249
-250 305

result:

ok OK! rot=1

Test #46:

score: 0
Accepted
time: 146ms
memory: 17704kb

input:

250 250
oooxoxxxooooooxxxxxoxxoxxoxoxoooooooooxoxxxxoooxxxoxoooxoxoxooooxxoooxxoxoxoxoooxoooxxxxoooooxxxoxxoxxxoooxoooxxooxoxoxxooxxoxoxxxooxoxxoooxooooxxxxxxxoxxooxoxxxxoxoooxoxxoxoxxxxoxooxxxooxoooxooooxoxxoooxooxxxoxxxoooxxoxxxoxoxooxxoxxxoooxoxoxxoooxxxx
xxoxoxxoooxoxooxxoxooxxxoxxxooxxxooooxooo...

output:

155 249
-250 50

result:

ok OK! rot=3

Test #47:

score: 0
Accepted
time: 134ms
memory: 17440kb

input:

250 250
oxxooxooxxoooooooxxxxoxooxxxooxoxxxxoxoxxxoxxxxooxoxooxxxxxxxxooooooxoooooxoxxoxooxoooxxoxooxoxxoxoxxooxoooooooxoxoooxoooxxoxoxoooooxxxooxoxxoxxooooxooxooxoxxxxoxoooxoooxoxooxxxxxooooxooxxxoooxooxxoooxoxxxxoxoxooxxooooxxxoxxooooxxooxoxxooxxooooxoooox
xxxooxoooooxxoxxoxxxoxoooxoxxxxxxooxoxxxo...

output:

249 154
260 -250

result:

ok OK! rot=3

Test #48:

score: 0
Accepted
time: 229ms
memory: 30648kb

input:

500 500
xooxoxooxoxooxoxoxxxxxoooooxoxxxoxoooxooxxoxxxoxxxoxoooxxooooxxxoxxxooooxooooxoxxxoxoooxxxoxxxooxxoxxoooxoxoxoxxoooxoxxooxxoxoxoxxxxxxoxoxxxxxoooxxxxxxoxxooxoxxxoooxxxooxxoxoooxoxooooxoooxooxooxooxoooxooooxoxoxxxxxoxxxxoooxxoooooxoooxoxooxoxoxooxoxxoxoxoxooooxoxoxxxooxxxxxxxoxxxooxooxooxxxoo...

output:

188 120
390 104

result:

ok OK! rot=0

Test #49:

score: 0
Accepted
time: 710ms
memory: 34904kb

input:

500 500
xxoxoxoxoxooxxxxxxoooxxoxxoxxxoxoxooooxxoxoxoooooxoooxxxoxxxooooxoxoxxxxxoxxoxoooxoxxxoxxoxoxooxxxxoxxxoxooxxxooooxxxoxxooxxxooxxxxooooooxoxoxoxoxoooxxoooxxooooxxxxoxoxooxxxoooxooooooooxoooooooooooxooxooooooxoxooooxoxxooxxooooooooxooooooxooxoxooooxooooxoooxoxxxooxoxxoooooooxxxooooxoooxoxoooo...

output:

98 295
62 338

result:

ok OK! rot=3

Test #50:

score: 0
Accepted
time: 1012ms
memory: 33604kb

input:

500 500
xoxooxxooxxooxooxxoxxxoooxxooooxooxxooxxxxxxxxoxxooxoooooxxooxxxoxxxxoxxoxxxooooooxxxoxxxoxxoxxxxoxxoxxoxooxooxxoxxxoooxxoooxxxooooooxooxxxxoxxooxxxooxxxoooxoxxxxxxoxxxoxxxxxooxooxxxxxoxoxxooxxooxoxxxoxxooxxooooxxxoxxxoxooxxxxoxoxxxoxoooooooooooxooxoxxoxoxoooxxxxxxxxxxoxoooxoxxoxoooxoxxxxxxx...

output:

26 16
409 159

result:

ok OK! rot=2

Test #51:

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

input:

10 10
xxxxxxxxox
xxxxxxxxxo
xxxxxxxoxx
xxxxxxoxxx
xxxxoxxxxx
xxxxxxxxxx
xxoxxxxxxx
xxxoxxxxxx
xoxxxxxxxx
oxxxxxxxxx
10 10
xxxxxxxxxo
xxxxxxxxox
xxxxxxoxxx
xxxxxxxoxx
xxxxxxxxxx
xxxxoxxxxx
xxxoxxxxxx
xxoxxxxxxx
oxxxxxxxxx
xoxxxxxxxx

output:

4 4
5 4

result:

ok OK! rot=2

Test #52:

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

input:

10 10
xoxxxxxxxx
oxxxxxxxxx
xxoxxxxxxx
xxxoxxxxxx
xxxxxxxxxx
xxxxoxxxxx
xxxxxxxoxx
xxxxxxoxxx
xxxxxxxxox
xxxxxxxxxo
10 10
xxxxxxxxxo
xxxxxxxxox
xxxxxxoxxx
xxxxxxxoxx
xxxxxxxxxx
xxxxoxxxxx
xxxoxxxxxx
xxoxxxxxxx
oxxxxxxxxx
xoxxxxxxxx

output:

4 5
4 4

result:

ok OK! rot=1

Test #53:

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

input:

10 10
xxxxxxxxxo
xxxxxxxxox
xxxxxxoxxx
xxxxxxxoxx
xxxxxxxxxx
xxxxxoxxxx
xxxoxxxxxx
xxoxxxxxxx
oxxxxxxxxx
xoxxxxxxxx
10 10
xxxxxxxxxo
xxxxxxxxox
xxxxxxoxxx
xxxxxxxoxx
xxxxxxxxxx
xxxxoxxxxx
xxxoxxxxxx
xxoxxxxxxx
oxxxxxxxxx
xoxxxxxxxx

output:

5 5
4 5

result:

ok OK! rot=0

Test #54:

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

input:

10 10
oxxxxxxxxx
xoxxxxxxxx
xxxoxxxxxx
xxoxxxxxxx
xxxxxoxxxx
xxxxxxxxxx
xxxxxxoxxx
xxxxxxxoxx
xxxxxxxxxo
xxxxxxxxox
10 10
xxxxxxxxxo
xxxxxxxxox
xxxxxxoxxx
xxxxxxxoxx
xxxxxxxxxx
xxxxoxxxxx
xxxoxxxxxx
xxoxxxxxxx
oxxxxxxxxx
xoxxxxxxxx

output:

5 4
5 5

result:

ok OK! rot=3

Test #55:

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

input:

10 10
xxxxxxxxxo
xxxxxxxxox
xxxxxxoxxx
xxxxxxxoxx
xxxxxxxxxx
xxxxoxxxxx
xxxoxxxxxx
xxoxxxxxxx
oxxxxxxxxx
xoxxxxxxxx
10 10
xxxxxxxxox
xxxxxxxxxo
xxxxxxxoxx
xxxxxxoxxx
xxxxoxxxxx
xxxxxxxxxx
xxoxxxxxxx
xxxoxxxxxx
xoxxxxxxxx
oxxxxxxxxx

output:

4 5
5 5

result:

ok OK! rot=2

Test #56:

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

input:

10 10
oxxxxxxxxx
xoxxxxxxxx
xxxoxxxxxx
xxoxxxxxxx
xxxxxxxxxx
xxxxxoxxxx
xxxxxxoxxx
xxxxxxxoxx
xxxxxxxxxo
xxxxxxxxox
10 10
xxxxxxxxox
xxxxxxxxxo
xxxxxxxoxx
xxxxxxoxxx
xxxxoxxxxx
xxxxxxxxxx
xxoxxxxxxx
xxxoxxxxxx
xoxxxxxxxx
oxxxxxxxxx

output:

5 5
5 4

result:

ok OK! rot=1

Test #57:

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

input:

9 11
xxxooxxoxox
oxoxxxxxxxx
xxxoxooooxx
xxooxxooxox
oxxoxoxxxxx
xxxxxxxoxxo
ooooxoxoxxo
oxxoxxxoxox
xxxoxxoxxxx
11 9
xxxxxooxx
oxxoxxxox
xxoxxxxxx
oxooxooox
xxoooxxxo
xxoxoxoxx
oxxxxxxxx
oxoooxooo
xoxoxxoxx
xxxxxxoxx
xoxxxxoox

output:

0 4
6 4

result:

ok OK! rot=1

Test #58:

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

input:

11 9
xxxxxooxx
oxxoxxxox
xxoxxxxxx
oxooxooox
xxooxxxxo
xxoxoxoxx
oxxxxxxxx
oxoooxooo
xoxoxxoxx
xxxxxxoxx
xoxxoxoox
9 11
xxxxoxxoxxx
xoxoxxxoxxo
oxxoxoxoooo
oxxoxxxxxxx
xxxxooxoxxx
xoxooxxooxx
xxooooxoxxx
xxxxxxxxoxo
xoxoxxooxxx

output:

4 10
4 4

result:

ok OK! rot=1

Test #59:

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

input:

11 9
xooxoxxox
xxoxxxxxx
xxoxxoxox
oooxoooxo
xxxxxxxxo
xxoxoxoxx
oxxxxooxx
xoooxooxo
xxxxxxoxx
xoxxxoxxo
xxooxxxxx
9 11
xxxooxxoxox
oxoxxxxxxxx
xxxoxooooxx
xxooxxooxox
xxxoxooxxxx
xxxxxxxoxxo
ooooxoxoxxo
oxxoxxxoxox
xxxoxxoxxxx

output:

4 0
4 6

result:

ok OK! rot=1

Test #60:

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

input:

9 11
xxxoxxoxxxx
oxxoxxxoxox
ooooxoxoxxo
xxxxxxxoxxo
oxxoxoxxxxx
xxooxxooxox
xxxoxooooxx
oxoxxxxxxxx
xxxooxxoxox
11 9
xoxxxxoox
xxxxxxoxx
xoxoxxoxx
oxoooxooo
oxxxxxxxx
xxoxoxoxx
xxoooxxxo
oxooxooox
xxoxxxxxx
oxxoxxxox
xxxxxooxx

output:

0 4
6 4

result:

ok OK! rot=3

Test #61:

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

input:

9 11
xoxoxxooxxx
xxxxxxxxoxo
xxooooxoxxx
xoxooxxooxx
xxxxxoxoxxo
oxxoxxxxxxx
oxxoxoxoooo
xoxoxxxoxxo
xxxxoxxoxxx
11 9
xxooxxxxx
xoxxxoxxo
xxxxxxoxx
xoooxooxo
oxxxoooxx
xxoxoxoxx
xxxxxxxxo
oooxoooxo
xxoxxoxox
xxoxxxxxx
xooxxxxox

output:

10 4
4 4

result:

ok OK! rot=3

Test #62:

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

input:

10 4
xoxx
oxxo
xxxx
xxxx
ooxx
xxxx
xxxo
oxxx
ooxx
oxoo
4 12
oxxooxxoxxox
xxxoxxxoxxxo
xxoxxxxxxxxx
xxoxxoxxxxox

output:

0 9
0 11

result:

ok OK! rot=3

Test #63:

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

input:

10 4
ooxo
xxoo
xxxo
oxxx
xxxx
xxoo
xxxx
xxxx
oxxo
xxox
4 12
xoxxxxoxxoxx
xxxxxxxxxoxx
oxxxoxxxoxxx
xoxxoxxooxxo

output:

3 0
3 -2

result:

ok OK! rot=3

Test #64:

score: 0
Accepted
time: 55ms
memory: 19356kb

input:

500 500
oxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

0 0
499 749

result:

ok OK! rot=0

Test #65:

score: 0
Accepted
time: 87ms
memory: 19440kb

input:

500 500
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

0 499
749 0

result:

ok OK! rot=0

Test #66:

score: 0
Accepted
time: 92ms
memory: 19436kb

input:

500 500
oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo...

output:

499 499
0 -250

result:

ok OK! rot=0

Test #67:

score: 0
Accepted
time: 60ms
memory: 19380kb

input:

500 500
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

499 0
-250 499

result:

ok OK! rot=0