QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#61403#2615. Surround the CattichecAC ✓35ms11648kbC++146.3kb2022-11-12 20:35:392022-11-12 20:35:42

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-12 20:35:42]
  • 评测
  • 测评结果:AC
  • 用时:35ms
  • 内存:11648kb
  • [2022-11-12 20:35:39]
  • 提交

answer

// #include <bits/stdc++.h>
// #define up 100
// using namespace std;
// #define mkp make_pair
// #define pb push_back
// mt19937 mt(20080820);
// int vist[1005][1005], flag = 6 * 9;
// int f[405][405], wz[1005][1005];
// int gs = 0;
// bool check(int x,int y){
// 	if(max(abs(x),abs(y))==9)return 1;
// 	if(abs(x-y)==9)return 1;
// 	return 0;
// }
// vector<pair<int, int>>v1, v2;
// void del1(int x,int y){
// 	for(auto cc=v1.begin();cc!=v1.end();cc++){
// 		auto cu=*cc;
// 		if(cu.first==x&&cu.second==y){v1.erase(cc);break;}
// 	}
// }
// void del2(int x,int y){
// 	for(auto cc=v2.begin();cc!=v2.end();cc++){
// 		auto cu=*cc;
// 		if(cu.first==x&&cu.second==y){v2.erase(cc);break;}
// 	}
// }
// void opt(int x,int y){
// 	if(!vist[x+up][y+up]){
// 		vist[x+up][y+up]=1;
// 		if(check(x,y))flag--;
// 	}
// 	del1(x,y);del2(x,y);
// 	printf("%d %d\n",x,y);
// }
// void add(int x,int y,int xx,int yy){
// 	int a=wz[x+up][y+up],b=wz[xx+up][yy+up];
// 	if(a&&b)f[a][b]=f[b][a]=1;
// }
// int dis(int x,int y,int xx,int yy){
// 	int a=wz[x+up][y+up],b=wz[xx+up][yy+up];
// 	if(a&&b)return f[a][b];
// 	return 1e9;
// }
// int main(){
// 	int tot=0;
// 	for(int i=-9;i<=9;i++){
// 		int L=-9,R=9;
// 		if(L<0)R=9+i;
// 		else L=-9+i;
// 		for(int j=L;j<=R;j++){
// 			v1.pb(mkp(i,j));
// 			wz[i+up][j+up]=++tot;
// 			if(check(i,j))v2.pb(mkp(i,j));
// 		}
// 	}
// 	memset(f,63,sizeof f);
// 	for(int i=1;i<=tot;i++)f[i][i]=0;
// 	for(auto vv:v1){
// 		int X=vv.first,Y=vv.second;
// 		add(X,Y,X,Y+1);
// 		add(X,Y,X+1,Y);
// 		add(X,Y,X+1,Y+1);
// 	}
// 	for(int k=1;k<=tot;k++)
// 		for(int i=1;i<=tot;i++)
// 			for(int j=1;j<=tot;j++)
// 				f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
// 	int cx,cy;scanf("%d%d",&cx,&cy);
// 	srand(time(NULL));
// 	int xx=7;opt(xx,xx);
// 	while(1){
// 		if(scanf("%d%d",&cx,&cy)==EOF)return 0;
// 		if(cx>cy&&!vist[xx+up][0+up]){opt(xx,0);continue;}
// 		if(cy<0&&!vist[0+up][-xx+up]){opt(0,-xx);continue;}
// 		if(cx<0&&!vist[-xx+up][-xx+up]){opt(-xx,-xx);continue;}
// 		if(cx<cy&&!vist[-xx+up][0+up]){opt(-xx,0);continue;}
// 		if(cy>0&&!vist[0+up][xx+up]){opt(0,xx);continue;}
// 		if(cx>0&&!vist[xx+up][xx+up]){opt(xx,xx);continue;}
// 		if(!flag){
// 			auto dy=v1[mt()%v1.size()];
// 			while(dy.first==cx&&dy.second==cy)dy=v1[mt()%v1.size()];
// 			opt(dy.first,dy.second);
// 			continue;
// 		}
// 		int mx=1e9;
// 		for(auto cu:v2){
// 			int dd=dis(cx,cy,cu.first,cu.second);
// 			mx=min(mx,dd);
// 		}
// 		vector<pair<int, int>>g;
// 		for(auto cu:v2){
// 			int dd=dis(cx,cy,cu.first,cu.second);
// 			if(dd==mx)g.pb(cu);
// 		}
// 		vector<pair<int,int>>gg;
// 		mx=1e9;
// 		for(auto cu:g){
// 			int dd=0;
// 			for(auto uc:g)dd+=dis(cu.first,cu.second,uc.first,uc.second);
// 			if(mx>dd)mx=dd;
// 		}for(auto cu:g){
// 			int dd=0;
// 			for(auto uc:g)dd+=dis(cu.first,cu.second,uc.first,uc.second);
// 			if(mx==dd)gg.pb(cu);
// 		}
// 		auto dy=gg[mt()%gg.size()];
// 		opt(dy.first, dy.second);
// 	}
// 	return 0;
// }
#include <bits/stdc++.h>
#define AA 100
using namespace std;
mt19937 mt(20080820);
int vist[1005][1005], flag = 6 * 9;
int f[405][405], wz[1005][1005];
int gs = 0;

bool check(int x, int y) {
	if (max(abs(x), abs(y)) == 9)
		return 1;
	if (abs(x - y) == 9)
		return 1;
	return 0;
}
vector<pair<int, int>>v1, v2;

void del1(int x, int y) {
	for (auto cc = v1.begin(); cc != v1.end(); ++cc) {
		auto cu = *cc;
		if (cu.first == x && cu.second == y) {
			v1.erase(cc);
			break;
		}
	}
}

void del2(int x, int y) {
	for (auto cc = v2.begin(); cc != v2.end(); ++cc) {
		auto cu = *cc;
		if (cu.first == x && cu.second == y) {
			v2.erase(cc);
			break;
		}
	}
}

void opt(int x, int y) {
	if (!vist[x + AA][y + AA]) {
		vist[x + AA][y + AA] = 1;
		if (check(x, y))
			--flag;
	}
	del1(x, y), del2(x, y);
	cout << x << " " << y << endl;
}

void addedge(int x, int y, int xx, int yy) {
	int A = wz[x + AA][y + AA], B = wz[xx + AA][yy + AA];
	if (A && B)
		f[A][B] = f[B][A] = 1;
}

int dis(int x, int y, int xx, int yy) {
	int A = wz[x + AA][y + AA], B = wz[xx + AA][yy + AA];
	if (A && B)
		return f[A][B];
	return 1e9;
}

int main() {
	int tot = 0;
	for (int i = -9; i <= 9; ++i) {
		int L = -9, R = 9;
		if (i < 0)
			R = 9 + i;
		else
			L = -9 + i;
		for (int j = L; j <= R; ++j) {
			v1.emplace_back(make_pair(i, j));
			wz[i + AA][j + AA] = ++tot;
			if (check(i, j)) {
				v2.emplace_back(make_pair(i, j));
			}
		}
	}
	memset(f, 63, sizeof(f));
	for (int i = 1; i <= tot; ++i)
		f[i][i] = 0;
	for (auto vv : v1) {
		int X = vv.first, Y = vv.second;
		addedge(X, Y, X, Y + 1);
		addedge(X, Y, X + 1, Y);
		addedge(X, Y, X + 1, Y + 1);
	}
	for (int k = 1; k <= tot; ++k)
		for (int i = 1; i <= tot; ++i)
			for (int j = 1; j <= tot; ++j) {
				f[i][j] = min(f[i][j], f[i][k] + f[k][j]);
			}
	int Cx, Cy;
	cin >> Cx >> Cy;
	srand(time(NULL));
	int xx = 7;
	opt(xx, xx);
	while (1) {
		if (scanf("%d%d", &Cx, &Cy) == EOF)
			return 0;
		if (Cx > Cy && !vist[xx + AA][0 + AA]) {
			opt(xx, 0);
			continue;
		}
		if (Cy < 0 && !vist[0 + AA][-xx + AA]) {
			opt(0, -xx);
			continue;
		}
		if (Cx < 0 && !vist[-xx + AA][-xx + AA]) {
			opt(-xx, -xx);
			continue;
		}
		if (Cx < Cy && !vist[-xx + AA][0 + AA]) {
			opt(-xx, 0);
			continue;
		}
		if (Cy > 0 && !vist[0 + AA][xx + AA]) {
			opt(0, xx);
			continue;
		}
		if (Cx > 0 && !vist[xx + AA][xx + AA]) {
			opt(xx, xx);
			continue;
		}
		if (!flag) {
			auto dy = v1[mt() % v1.size()];
			while (dy.first == Cx && dy.second == Cy)
				dy = v1[mt() % v1.size()];
			opt(dy.first, dy.second);
			continue;
		}
		int mx = 1e9;
		for (auto cu : v2) {
			int dd = dis(Cx, Cy, cu.first, cu.second);
			mx = min(mx, dd);
		}
		vector<pair<int, int>>g;
		for (auto cu : v2) {
			int dd = dis(Cx, Cy, cu.first, cu.second);
			if (dd == mx)
				g.emplace_back(cu);
		}
		vector<pair<int, int>>gg;
		mx = 1e9;
		for (auto cu : g) {
			int dd=0;
			for(auto uc:g)
				dd+=dis(cu.first,cu.second,uc.first,uc.second);
			if(mx>dd)mx=dd;
		}
		for (auto cu : g) {
			int dd=0;
			for(auto uc:g)
				dd+=dis(cu.first,cu.second,uc.first,uc.second);
			if (mx == dd)
				gg.emplace_back(cu);
		}
		auto dy = gg[mt() % gg.size()];
		opt(dy.first, dy.second);
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 26ms
memory: 5596kb

input:

0 0
1 0
1 -1
1 -2
1 -3
2 -3
2 -4
3 -4
2 -5
3 -4
2 -5
1 -6
2 -5
3 -4
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
2 -5
3 -4
2 -5
3 -4
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
5 -2
6 -1
5 -2
4 -3
5 -2
6 -1
5 -2
4 -3
5 -2
6 -1
5 -1
6 -1
7 -1
8 ...

output:

7 7
7 0
0 -7
4 -5
3 -6
5 -4
2 -7
6 -3
1 -8
7 -2
-1 -9
0 -9
-2 -9
8 -1
9 1
9 0
9 2
9 3
9 4
9 5
9 6
-3 -9
-4 -9
-5 -9
-6 -9
-7 -9
-8 -9
-9 -7
-9 -8
9 7
-9 -6
-9 -9
-9 -5
9 8
-9 -4
6 9
7 9
8 9
9 9
5 9
4 9
3 9
2 9
-9 -3
-9 -2
-9 -1
1 9
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
3 -4
-7 -4
-2 0
4 5...

result:

ok There is no valid neighbouring location.

Test #2:

score: 0
Accepted
time: 24ms
memory: 5840kb

input:

0 0
-1 0
-2 0
-3 0
-4 0
-5 0
-5 1
-5 2
-4 3
-5 2
-6 1
-5 2
-4 3
-5 2
-4 3
-3 4
-4 3
-5 2
-4 3
-5 2
-6 1
-5 2
-6 1
-5 2
-6 1
-5 2
-4 3
-5 2
-4 3
-5 2
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-2 5
-3 4
-4 3
-3 4
-2 5
-1 6
-2 5
-3 4
-2 5
-1 6
-2 5
-1 6
-2 5
-3 4
-2 5
-1 6
-2 5
-1 6
-2 5
-1 6
-2 5
-3 4
-4 3
-5 3
-...

output:

7 7
-7 -7
-7 0
-9 0
-9 -1
-8 1
0 7
-6 3
-4 5
-7 2
-5 4
-9 -2
-3 6
-2 7
-1 8
1 9
0 9
-9 -3
2 9
-9 -4
-9 -5
-9 -6
-9 -7
3 9
-9 -8
4 9
5 9
-7 -9
6 9
-8 -9
7 9
8 9
-5 -9
9 7
-6 -9
9 6
9 8
9 5
-9 -9
9 9
9 4
9 3
-3 -9
-4 -9
-2 -9
9 2
-1 -9
9 1
5 -4
4 -5
6 -3
3 -6
7 -2
2 -7
8 -1
1 -8
0 -9
9 0
0 5
-1 5
3 7
...

result:

ok There is no valid neighbouring location.

Test #3:

score: 0
Accepted
time: 18ms
memory: 5856kb

input:

0 0
1 1
2 2
3 3
4 4
5 5
6 5
7 5
7 4
7 3
7 4
7 3
7 4
7 3
7 4
7 3
7 4
7 3
7 2
7 1
7 2
7 3
7 2
7 1
7 2
7 1
7 2
7 3
7 2
7 3
7 2
7 3
7 4
7 3
7 4
7 5
7 6
7 5
7 4
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 4
7 5
7 6
7 5
7 6
7 5
7 4
7 5
7 6
8 6
7 6
7 5
8 5
8 4
8 5
8 6
8 5
8 4
8 5
8 4
8 5
8 6
8 7
7 6
8 6
8 5
8 4
...

output:

7 7
0 7
9 9
8 9
9 8
7 9
7 0
9 6
9 4
9 5
9 3
9 2
9 7
9 1
8 -1
7 -2
9 0
6 -3
5 -4
4 -5
3 -6
6 9
2 -7
1 -8
5 9
-2 -9
4 9
3 9
-3 -9
2 9
-1 -9
-4 -9
1 9
0 -9
-3 6
-1 8
-2 7
-4 5
0 9
-5 4
-6 3
-7 -9
-7 2
-6 -9
-8 -9
-5 -9
-8 1
-9 -4
-9 -5
-9 -3
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 -9
-9 0
3 -4
-7 -4
-2 0
4 5
...

result:

ok There is no valid neighbouring location.

Test #4:

score: 0
Accepted
time: 22ms
memory: 5840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-9
-7 -9
-9 -3
-8 -9
-6 -9
-9 -2
-5 -9
-4 -9
-9 -1
-8 1
-9 0
-7 2
-6 3
-5 4
-4 5
-3 6
-2 7
-1 8
1 9
3 9
0 9
2 9
-3 -9
4 9
-2 -9
-1 -9
2 -7
3 -6
1 -8
4 -5
5 9
6 9
5 -4
0 -9
6 -3
7 -2
7 9
8 -1
8 9
9 5
9 4
9 6
9 3
9 7
9 2
9 8
9 1
9 0
9 9
0 6
-1 5
3 7...

result:

ok There is no valid neighbouring location.

Test #6:

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

input:

0 0
-1 0
-2 0
-3 0
-4 0
-4 1
-4 2
-5 2
-4 3
-5 2
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-5 2
-6 1
-5 2
-6 1
-5 2
-6 1
-5 2
-4 3
-5 2
-4 3
-5 2
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-5 2
-6 1
-5 2
-6 1
-5 2
-4 3
-5 2
-6 1
-5 2
-6 1
-5 2
-6 1
-5 2
-6 1
-5 2
-5 1
-4 2
-...

output:

7 7
-7 -7
-7 0
-9 0
-9 -1
0 7
-5 4
-7 2
-4 5
-6 3
-3 6
-2 7
-8 1
-1 8
-9 -2
1 9
0 9
2 9
-9 -3
-9 -4
-9 -5
-9 -6
-9 -7
3 9
-9 -8
4 9
5 9
-7 -9
6 9
-8 -9
7 9
8 9
-5 -9
9 7
-6 -9
9 6
-4 -9
9 5
-9 -9
9 8
9 3
9 4
-3 -9
9 2
-2 -9
9 9
-1 -9
9 1
5 -4
4 -5
6 -3
3 -6
7 -2
2 -7
8 -1
1 -8
0 -9
9 0
0 5
-1 5
3 7
...

result:

ok There is no valid neighbouring location.

Test #7:

score: 0
Accepted
time: 29ms
memory: 5760kb

input:

0 0
-1 0
-2 0
-2 1
-2 2
-3 2
-3 3
-3 4
-4 3
-3 4
-4 3
-5 2
-6 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 -1
-9 -3
-9 -4
-9 0
9 3
-9 -5
9 2
-9 -6
9 1
-9 -7
5 -4
7 -2
4 -5
6 -3
8 -1
3 -6
2 -7
1 -8
9 0
-9 -8
-4 -9
-5 -9
-3 -9
-6 -9
-2 -9
-7 -9
-1 -9
-8 -9
-9 -9
0 -9
3 -3
-7 -4
-2 1
4 6...

result:

ok There is no valid neighbouring location.

Test #9:

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

input:

0 0
-1 -1
-2 -2
-3 -3
-4 -4
-5 -5
-5 -6
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4...

output:

7 7
0 -7
-7 -7
-9 -9
-9 -8
-8 -9
7 0
-6 -9
-4 -9
-5 -9
-3 -9
-2 -9
-1 -9
-7 -9
-9 -7
1 -8
0 -9
2 -7
-9 -6
-9 -5
-9 -4
-9 -3
-9 -2
3 -6
-9 -1
4 -5
-8 1
5 -4
6 -3
-7 2
7 -2
8 -1
-5 4
9 3
-6 3
9 2
-4 5
9 1
-9 0
9 4
9 5
9 0
9 6
9 7
-3 6
-1 8
-2 7
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #10:

score: 0
Accepted
time: 18ms
memory: 5712kb

input:

0 0
1 1
2 1
3 2
4 2
5 2
6 3
7 3
7 4
7 3
7 2
7 1
7 2
7 3
7 2
7 3
7 2
7 1
7 2
7 3
7 2
7 3
7 4
7 5
7 6
7 5
7 4
7 3
7 4
7 3
7 4
7 3
7 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 9
8 9
4 9
3 9
5 9
2 9
9 9
-9 -2
-9 -1
1 9
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
6 3
0 3
-1 -5
5 2
-...

result:

ok There is no valid neighbouring location.

Test #12:

score: 0
Accepted
time: 35ms
memory: 5712kb

input:

0 0
1 1
1 2
2 3
2 4
3 5
3 6
4 7
3 7
2 7
1 7
2 7
1 7
2 7
3 7
4 7
5 7
4 7
3 7
2 7
1 7
2 7
3 7
2 7
1 7
2 7
1 7
2 7
3 7
4 7
3 7
4 7
3 7
2 7
3 7
2 7
3 7
4 7
5 7
4 7
5 7
6 7
5 7
6 7
5 7
4 7
3 7
4 7
5 7
4 7
5 7
4 7
3 7
4 7
5 7
4 7
3 7
3 6
2 5
1 4
2 4
1 3
1 4
0 4
0 3
0 4
0 5
0 6
0 5
0 4
-1 3
0 4
1 5
2 5
1 5...

output:

7 7
0 7
-7 0
5 9
4 9
6 9
3 9
7 9
2 9
1 9
-1 8
0 9
-2 7
-3 6
8 9
9 8
9 9
9 7
-4 5
-5 4
-6 3
9 6
9 5
-7 2
-8 1
9 4
-9 -2
-9 -1
9 3
9 2
-9 -4
9 1
-9 -3
-9 0
-9 -5
-9 -6
6 -3
7 -2
8 -1
5 -4
9 0
4 -5
3 -6
2 -7
-9 -7
-9 -8
1 -8
-4 -9
-5 -9
-3 -9
-6 -9
-2 -9
-7 -9
-1 -9
-8 -9
-9 -9
0 -9
3 -3
-7 -4
-2 1
4 6...

result:

ok There is no valid neighbouring location.

Test #13:

score: 0
Accepted
time: 24ms
memory: 5944kb

input:

0 0
-1 -1
-2 -1
-3 -2
-4 -3
-5 -4
-6 -4
-7 -5
-7 -4
-7 -5
-7 -4
-7 -5
-7 -4
-7 -5
-7 -6
-7 -5
-7 -6
-7 -5
-7 -4
-7 -5
-7 -6
-7 -5
-7 -4
-7 -5
-7 -6
-7 -5
-7 -6
-7 -5
-7 -6
-7 -5
-7 -4
-7 -3
-7 -2
-7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-7 2
-1 8
-8 1
-9 0
0 9
6 3
0 3
-1 -5
5 2
-...

result:

ok There is no valid neighbouring location.

Test #15:

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

input:

0 0
0 -1
-1 -2
-2 -3
-3 -4
-3 -5
-4 -6
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-4 ...

output:

7 7
7 0
0 -7
-7 -7
-6 -9
-5 -9
-4 -9
-7 -9
-3 -9
-2 -9
-8 -9
-1 -9
1 -8
2 -7
0 -9
-9 -8
-9 -9
-9 -7
-9 -6
-9 -5
3 -6
-9 -4
4 -5
-9 -3
-9 -2
5 -4
-9 -1
-7 2
6 -3
7 -2
-6 3
-8 1
-9 0
-5 4
8 -1
-4 5
-3 6
9 4
-2 7
9 3
9 5
9 2
9 6
9 1
9 7
9 0
-1 8
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #16:

score: 0
Accepted
time: 24ms
memory: 11648kb

input:

0 0
0 -1
0 -2
-1 -3
-1 -4
-1 -5
-1 -6
-2 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -...

output:

7 7
7 0
0 -7
-7 -7
-4 -9
-3 -9
-1 -9
-2 -9
-5 -9
0 -9
2 -7
-6 -9
1 -8
3 -6
-7 -9
-8 -9
-9 -8
-9 -7
-9 -9
-9 -6
-9 -5
-9 -4
-9 -3
4 -5
-9 -2
5 -4
-9 -1
6 -3
7 -2
8 -1
9 2
9 1
9 4
9 3
9 5
9 0
-5 4
9 6
-7 2
-6 3
-9 0
-8 1
-4 5
-3 6
-2 7
9 7
-1 8
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #17:

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

input:

0 0
-1 -1
-2 -2
-3 -3
-4 -4
-5 -5
-6 -5
-7 -5
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -5
-7 -4
-7 -5
-7 -4
-7 -5
-7 -6
-7 -5
-7 -4
-7 -5
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -1
-7...

output:

7 7
0 -7
-7 -7
-9 -9
-9 -8
-8 -9
-7 0
-9 -6
-9 -4
-9 -5
-9 -3
-9 -2
-9 -7
-7 -9
-9 -1
-6 -9
-8 1
-5 -9
-4 -9
-9 0
-7 2
-6 3
-5 4
-4 5
-3 -9
-3 6
-2 -9
-2 7
-1 -9
-1 8
2 -7
2 9
3 -6
3 9
4 -5
1 9
1 -8
4 9
0 -9
5 9
0 9
6 9
6 -3
7 9
5 -4
8 -1
7 -2
8 9
9 5
9 4
9 6
9 3
9 7
9 2
9 8
9 1
9 0
9 9
0 6
-1 5
3 7...

result:

ok There is no valid neighbouring location.

Test #18:

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

input:

0 0
0 -1
-1 -2
-2 -3
-3 -4
-4 -5
-5 -6
-6 -7
-5 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-6 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3 -7
-2 -7
-1 -7
-2 -7
-3 -7
-2 -7
-1 -7
-2 -7
-3 -7
-2 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 ...

output:

7 7
7 0
0 -7
-7 -7
-6 -9
-7 -9
-5 -9
-8 -9
-4 -9
-3 -9
-2 -9
-1 -9
1 -8
2 -7
0 -9
3 -6
4 -5
-9 -8
-9 -7
-9 -9
-9 -6
-9 -5
-9 -4
-9 -3
-9 -2
5 -4
-9 -1
-8 1
-6 3
6 -3
7 -2
-7 2
8 -1
-5 4
9 3
9 1
9 4
9 0
9 2
9 5
-4 5
9 6
9 7
-3 6
-9 0
-2 7
-1 8
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #19:

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

input:

0 0
0 1
-1 1
-2 1
-2 2
-3 2
-4 2
-4 3
-3 4
-4 3
-5 2
-4 3
-3 4
-4 3
-3 4
-2 5
-1 6
-2 5
-3 4
-2 5
-1 6
-2 5
-1 6
-2 5
-1 6
-2 5
-3 4
-4 3
-5 2
-6 1
-5 2
-6 1
-5 2
-4 3
-3 4
-4 3
-5 2
-4 3
-5 2
-4 3
-3 4
-2 5
-3 4
-4 3
-5 2
-4 3
-5 2
-4 3
-5 2
-4 3
-3 4
-2 5
-3 4
-4 3
-3 4
-2 5
-1 6
-2 5
-2 6
-1 6
-2...

output:

7 7
-7 0
-7 -7
0 7
-5 4
-6 3
-4 5
-7 2
-3 6
-8 1
-9 -1
-2 7
-1 8
-9 0
1 9
2 9
0 9
3 9
-9 -2
4 9
5 9
-9 -3
6 9
-9 -4
7 9
8 9
-9 -5
-9 -6
-9 -7
-9 -8
-7 -9
-8 -9
-6 -9
-5 -9
9 7
-9 -9
-4 -9
9 5
-3 -9
9 6
9 8
9 9
9 4
9 3
-2 -9
9 2
-1 -9
9 1
5 -4
4 -5
6 -3
3 -6
7 -2
2 -7
8 -1
1 -8
0 -9
9 0
0 5
-1 5
3 7
...

result:

ok There is no valid neighbouring location.

Test #20:

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

input:

0 0
1 0
2 0
2 -1
2 -2
2 -3
3 -3
4 -3
3 -4
4 -3
3 -4
2 -5
3 -4
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
2 -5
3 -4
2 -5
3 -4
2 -5
3 -4
2 -5
1 -6
2 -5
3 -4
4 -3
3 -4
4 -3
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
4 -3
3 -4
4 -3
5 -2
4 -3
5 -2
6 -1
5 -2
6 -2
7 -1
8 0
8 1
...

output:

7 7
7 0
9 0
0 -7
4 -5
5 -4
3 -6
6 -3
2 -7
7 -2
1 -8
-1 -9
0 -9
-2 -9
-3 -9
-4 -9
8 -1
9 2
-5 -9
9 1
9 3
-6 -9
-7 -9
9 4
9 5
-8 -9
9 6
-9 -7
9 7
-9 -8
-9 -9
-9 -5
-9 -4
9 8
-9 -6
7 9
5 9
-9 -3
-9 -2
4 9
3 9
6 9
8 9
2 9
1 9
9 9
-9 -1
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
3 -4
-7 -4
-2 0
0 7...

result:

ok There is no valid neighbouring location.

Test #21:

score: 0
Accepted
time: 22ms
memory: 9716kb

input:

0 0
-1 -1
-1 -2
-2 -3
-2 -4
-2 -5
-3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 4
9 3
9 2
9 1
7 -2
8 -1
6 -3
-6 3
-7 2
5 -4
9 0
4 -5
-8 1
-9 -3
3 -6
2 -7
-9 -4
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 0
-9 -5
1 -8
-4 -9
-5 -9
-3 -9
-6 -9
-2 -9
-7 -9
-1 -9
-8 -9
-9 -9
0 -9
3 -3
-7 -4
-2 1
4 6...

result:

ok There is no valid neighbouring location.

Test #23:

score: 0
Accepted
time: 24ms
memory: 9660kb

input:

0 0
0 -1
0 -2
-1 -3
-1 -4
-1 -5
-1 -6
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -...

output:

7 7
7 0
0 -7
-7 -7
-4 -9
-3 -9
-1 -9
-2 -9
-5 -9
1 -8
0 -9
2 -7
-6 -9
-7 -9
-8 -9
-9 -8
-9 -9
-9 -7
-9 -6
-9 -5
-9 -4
-9 -3
-9 -2
3 -6
-9 -1
4 -5
-8 1
5 -4
6 -3
-7 2
7 -2
8 -1
-5 4
9 3
-6 3
9 2
-4 5
9 1
-9 0
9 4
9 5
9 0
9 6
9 7
-3 6
-1 8
-2 7
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #24:

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

input:

0 0
-1 -1
-2 -1
-3 -1
-4 -1
-5 -1
-6 -1
-7 -1
-7 -2
-7 -3
-7 -2
-7 -3
-7 -2
-7 -3
-7 -2
-7 -1
-7 -2
-7 -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-2 -9
-1 -9
2 -7
3 -6
1 -8
0 -9
4 -5
5 -4
6 -3
5 9
7 -2
4 9
6 9
2 9
0 9
7 9
8 -1
8 9
9 5
9 4
9 6
9 3
9 7
9 2
9 8
9 1
9 0
9 9
0 6
-1 5
3 7...

result:

ok There is no valid neighbouring location.

Test #26:

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

input:

0 0
-1 -1
-2 -2
-3 -2
-4 -2
-5 -2
-6 -3
-7 -3
-7 -4
-7 -3
-7 -4
-7 -5
-7 -6
-7 -5
-7 -4
-7 -5
-7 -4
-7 -5
-7 -6
-7 -5
-7 -4
-7 -5
-7 -4
-7 -3
-7 -2
-7 -1
-7 -2
-7 -3
-7 -4
-7 -3
-7 -2
-7 -3
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -3
-7 -4
-7 -5
-7 -4
-7 -3
-7 -2
-7 -3
-7...

output:

7 7
0 -7
-7 -7
-7 0
-9 -5
-9 -4
-9 -3
-9 -6
-9 -7
-9 -2
-9 -8
-8 -9
-7 -9
-9 -9
-9 -1
-6 -9
-8 1
-5 -9
-4 -9
-9 0
-7 2
-6 3
-5 4
-4 5
-3 6
-2 7
-1 8
-3 -9
-2 -9
2 9
1 9
3 9
4 9
0 9
5 9
6 9
-1 -9
7 9
3 -6
5 -4
2 -7
6 -3
1 -8
0 -9
4 -5
7 -2
8 -1
8 9
9 5
9 4
9 6
9 3
9 7
9 2
9 8
9 1
9 0
9 9
0 6
-1 5
3 7...

result:

ok There is no valid neighbouring location.

Test #27:

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

input:

0 0
0 -1
-1 -2
-1 -3
-2 -4
-3 -5
-3 -6
-3 -7
-2 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-3 -7
-4 -7
-5 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-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
6 9
7 9
8 -1
8 9
9 5
9 4
9 6
9 3
9 7
9 2
9 8
9 1
9 0
9 9
0 6
-1 5
3 7...

result:

ok There is no valid neighbouring location.

Test #29:

score: 0
Accepted
time: 20ms
memory: 5640kb

input:

0 0
0 1
0 2
0 3
0 4
0 5
-1 5
-2 5
-3 4
-4 3
-5 2
-6 1
-5 2
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-2 5
-1 6
-2 5
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-5 2
-6 1
-5 2
-4 3
-5 2
-4 3
-3 4
-4 3
-5 2
-6 1
-5 2
-6 1
-5 2
-6 1
-5 2
-4 3
-3 3
-3 4
-4 4
-...

output:

7 7
-7 0
0 7
0 9
-1 8
1 9
-7 -7
-3 6
-4 5
-6 3
-5 4
-8 1
-7 2
-2 7
2 9
-9 -1
-9 -2
-9 0
3 9
4 9
5 9
-9 -3
-9 -4
-9 -5
6 9
-9 -6
7 9
-9 -7
8 9
-9 -8
9 6
-7 -9
9 7
-6 -9
9 8
-8 -9
9 5
-5 -9
9 4
-4 -9
9 9
-9 -9
-3 -9
-2 -9
9 2
9 3
-1 -9
9 1
5 -4
4 -5
6 -3
3 -6
7 -2
2 -7
8 -1
1 -8
0 -9
9 0
0 5
-1 5
3 7
...

result:

ok There is no valid neighbouring location.

Test #30:

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

input:

0 0
0 -1
-1 -2
-1 -3
-2 -4
-3 -5
-4 -6
-4 -7
-3 -7
-4 -7
-5 -7
-4 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3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4 6...

result:

ok There is no valid neighbouring location.

Test #32:

score: 0
Accepted
time: 28ms
memory: 5668kb

input:

0 0
-1 0
-2 0
-3 0
-4 0
-4 1
-5 1
-6 1
-5 2
-6 1
-5 2
-4 3
-5 2
-6 1
-5 2
-6 1
-5 2
-6 1
-5 2
-6 1
-5 2
-4 3
-3 4
-4 3
-5 2
-4 3
-5 2
-6 1
-5 2
-4 3
-5 2
-4 3
-3 4
-4 3
-5 2
-6 1
-5 2
-4 3
-5 2
-4 3
-5 2
-4 3
-5 2
-6 1
-5 2
-4 3
-3 4
-2 5
-1 6
-2 5
-1 6
-2 5
-3 4
-2 5
-1 6
-2 5
-1 6
-2 5
-3 5
-2 5
-...

output:

7 7
-7 -7
-7 0
-9 0
-9 -1
0 7
-6 3
-8 1
-5 4
-7 2
-4 5
-3 6
-9 -2
-9 -3
-2 7
-9 -4
-1 8
-9 -5
1 9
-9 -6
0 9
2 9
3 9
4 9
-9 -7
5 9
-9 -8
-8 -9
-6 -9
6 9
-7 -9
7 9
8 9
-5 -9
-9 -9
-4 -9
-3 -9
9 6
9 4
9 7
9 3
9 8
9 2
-2 -9
9 5
9 9
-1 -9
9 1
5 -4
4 -5
6 -3
3 -6
7 -2
2 -7
8 -1
1 -8
0 -9
9 0
0 5
-1 5
3 7
...

result:

ok There is no valid neighbouring location.

Test #33:

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

input:

0 0
1 0
2 0
3 0
4 0
4 -1
5 -1
6 -1
5 -2
6 -1
5 -2
4 -3
5 -2
6 -1
5 -2
4 -3
5 -2
4 -3
3 -4
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
2 -5
3 -4
4 -3
3 -4
4 -3
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
5 -2
6 -1
5 -2
4 -3
5 -2
4 -3
5 -2
4 -3
3 -4
4 -3
3 -4
2 -5
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
1 -5
1 -6
2 -5
...

output:

7 7
7 0
9 0
8 -1
9 1
0 -7
6 -3
7 -2
5 -4
9 2
4 -5
3 -6
9 3
9 4
2 -7
1 -8
-1 -9
0 -9
-2 -9
-3 -9
-4 -9
-5 -9
-6 -9
-7 -9
-8 -9
9 5
9 6
9 7
-9 -7
9 8
7 9
8 9
6 9
5 9
-9 -6
9 9
4 9
3 9
-9 -4
-9 -8
-9 -3
-9 -9
-9 -2
-9 -5
2 9
-9 -1
1 9
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
3 -4
-7 -4
-2 0
4 5...

result:

ok There is no valid neighbouring location.

Test #34:

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

input:

0 0
-1 0
-2 -1
-3 -1
-4 -2
-5 -2
-6 -2
-7 -3
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -3
-7 -4
-7 -3
-7 -2
-7 -3
-7 -2
-7 -3
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -3
-7 -4
-7 -3
-7 -2
-7 -3
-7 -2
-7 -3
-7 -4
-7 -5
-7 -4
-7 -5
-7 -4
-7 -5
-7 -4
-7 -3
-7 -4
-7 -3
-7 -2
-7 -1
-7 -2
-7 -1
-7 ...

output:

7 7
-7 -7
0 -7
-7 0
-9 -5
-9 -4
-9 -2
-9 -3
-9 -1
-8 1
-9 0
-7 2
-9 -6
-6 3
-9 -7
-9 -8
-8 -9
-7 -9
-5 4
-9 -9
-4 5
-6 -9
-3 6
-2 7
-5 -9
-1 8
-4 -9
1 9
3 9
-3 -9
-2 -9
2 9
4 9
5 9
0 9
-1 -9
3 -6
1 -8
2 -7
4 -5
0 -9
5 -4
6 -3
6 9
7 -2
7 9
8 -1
8 9
9 5
9 4
9 6
9 3
9 7
9 2
9 8
9 1
9 0
9 9
0 6
-1 5
3 7...

result:

ok There is no valid neighbouring location.

Test #35:

score: 0
Accepted
time: 18ms
memory: 7692kb

input:

0 0
1 0
2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
9 4
9 5
-1 -9
9 6
-2 -9
0 -9
-3 -9
-4 -9
-5 -9
-6 -9
-7 -9
-8 -9
9 7
-9 -7
-9 -8
-9 -6
-9 -9
-9 -5
-9 -4
-9 -3
9 8
5 9
6 9
8 9
7 9
4 9
3 9
2 9
9 9
-9 -2
-9 -1
1 9
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
3 -4
-7 -4
-2 0
4 5...

result:

ok There is no valid neighbouring location.

Test #37:

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

input:

0 0
-1 -1
-2 -2
-2 -3
-2 -4
-2 -5
-2 -6
-2 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-5...

output:

7 7
0 -7
-7 -7
7 0
-5 -9
-4 -9
-2 -9
-3 -9
-6 -9
-1 -9
-7 -9
1 -8
0 -9
2 -7
-8 -9
-9 -8
-9 -9
-9 -7
3 -6
-9 -6
4 -5
5 -4
-9 -5
-9 -4
6 -3
-9 -3
-9 -2
-9 -1
-7 2
7 -2
-8 1
-6 3
8 -1
-5 4
9 3
-9 0
9 2
9 1
9 4
9 0
9 5
9 6
9 7
-3 6
-2 7
-4 5
-1 8
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #38:

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

input:

0 0
0 1
0 2
0 3
-1 3
-1 4
-2 4
-3 4
-2 5
-3 4
-2 5
-3 4
-4 3
-5 2
-4 3
-5 2
-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 -4
9 0
4 -5
-8 1
-9 -3
-9 -2
-9 -5
-9 -1
-9 -6
-9 -4
-9 0
3 -6
2 -7
-9 -7
-9 -8
1 -8
-4 -9
-5 -9
-3 -9
-6 -9
-2 -9
-7 -9
-1 -9
-8 -9
-9 -9
0 -9
3 -3
-7 -4
-2 1
4 6...

result:

ok There is no valid neighbouring location.

Test #40:

score: 0
Accepted
time: 25ms
memory: 9748kb

input:

0 0
0 -1
0 -2
0 -3
0 -4
0 -5
-1 -6
-2 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-4 -7
-3 -7
-2 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-4 -7
-5 -7
-...

output:

7 7
7 0
0 -7
0 -9
-1 -9
1 -8
-7 -7
-3 -9
-4 -9
-6 -9
-5 -9
-8 -9
-7 -9
-2 -9
2 -7
-9 -8
-9 -9
-9 -7
3 -6
4 -5
5 -4
-9 -6
-9 -5
-9 -4
6 -3
-9 -3
7 -2
-9 -2
8 -1
-9 -1
9 2
-7 2
9 3
-6 3
-8 1
-5 4
9 4
9 0
9 1
-4 5
-9 0
-3 6
9 6
-2 7
9 5
9 8
9 7
-1 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #41:

score: 0
Accepted
time: 23ms
memory: 5908kb

input:

0 0
0 -1
0 -2
0 -3
1 -3
2 -3
3 -3
3 -4
4 -3
5 -2
4 -3
5 -2
4 -3
5 -2
4 -3
3 -4
4 -3
5 -2
4 -3
5 -2
6 -1
5 -2
4 -3
5 -2
4 -3
5 -2
4 -3
5 -2
4 -3
3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-8 -9
-3 -9
-2 -9
-9 -9
-1 -9
9 1
5 -4
4 -5
6 -3
3 -6
7 -2
2 -7
8 -1
1 -8
0 -9
9 0
0 5
-1 5
3 7
...

result:

ok There is no valid neighbouring location.

Test #43:

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

input:

0 0
0 -1
-1 -2
-2 -3
-2 -4
-3 -5
-4 -6
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-4 -7
-5 -7
-6 ...

output:

7 7
7 0
0 -7
-7 -7
-5 -9
-6 -9
-4 -9
-7 -9
-3 -9
-8 -9
-2 -9
-1 -9
1 -8
2 -7
0 -9
3 -6
4 -5
-9 -8
-9 -7
5 -4
-9 -9
-9 -6
-9 -5
-9 -4
6 -3
7 -2
-9 -3
-9 -2
-9 -1
-7 2
-6 3
8 -1
9 2
9 1
9 3
9 0
9 4
9 5
-8 1
-5 4
-9 0
-3 6
-4 5
9 6
-2 7
9 7
-1 8
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
-7 0...

result:

ok There is no valid neighbouring location.

Test #44:

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

input:

0 0
0 -1
0 -2
0 -3
0 -4
0 -5
1 -5
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
4 -3
3 -4
4 -3
5 -2
4 -3
5 -2
6 -1
5 -2
4 -3
3 -4
2 -5
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
5 -2
4 -3
5 -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
9 8
9 1
9 0
9 9
0 6
-1 5
3 7...

result:

ok There is no valid neighbouring location.

Test #46:

score: 0
Accepted
time: 18ms
memory: 5860kb

input:

0 0
0 -1
0 -2
0 -3
0 -4
0 -5
-1 -6
-2 -7
-3 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-...

output:

7 7
7 0
0 -7
0 -9
-1 -9
1 -8
-7 -7
-3 -9
-4 -9
-6 -9
-5 -9
-7 -9
-8 -9
-2 -9
2 -7
-9 -8
-9 -9
-9 -7
3 -6
4 -5
5 -4
-9 -6
6 -3
-9 -5
-9 -4
-9 -3
7 -2
-9 -2
8 -1
-9 -1
9 2
-7 2
9 3
-6 3
9 4
-8 1
9 1
-5 4
9 0
-4 5
-9 0
-3 6
9 6
-2 7
9 5
9 8
9 7
-1 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #47:

score: 0
Accepted
time: 34ms
memory: 5856kb

input:

0 0
0 -1
-1 -2
-2 -3
-3 -4
-3 -5
-3 -6
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 ...

output:

7 7
7 0
0 -7
-7 -7
-6 -9
-5 -9
-3 -9
-4 -9
-7 -9
-2 -9
-8 -9
-9 -8
-9 -9
-9 -7
-1 -9
1 -8
0 -9
2 -7
-9 -6
-9 -5
-9 -4
-9 -3
-9 -2
3 -6
-9 -1
4 -5
-8 1
5 -4
6 -3
-7 2
7 -2
8 -1
-5 4
9 3
-6 3
9 2
-4 5
9 1
-9 0
9 4
9 5
9 0
9 6
9 7
-3 6
-1 8
-2 7
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #48:

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

input:

0 0
1 1
2 2
3 3
3 4
4 5
5 6
5 7
4 7
3 7
4 7
3 7
2 7
3 7
2 7
1 7
2 7
1 7
2 7
3 7
4 7
5 7
4 7
3 7
2 7
1 7
2 7
1 7
2 7
3 7
2 7
1 7
2 7
3 7
4 7
5 7
6 7
5 7
6 7
5 7
4 7
5 7
6 7
5 7
6 7
5 7
4 7
5 7
4 7
5 7
6 7
5 7
6 7
5 7
6 7
5 7
4 7
5 8
5 7
4 7
3 7
2 6
2 5
1 4
1 3
2 4
3 5
2 5
3 6
3 7
3 6
4 7
3 6
3 5
2 5
...

output:

7 7
0 7
9 9
8 9
-7 0
6 9
5 9
7 9
4 9
3 9
2 9
1 9
-1 8
-2 7
0 9
-3 6
-4 5
-5 4
9 7
9 8
9 6
9 5
9 4
-6 3
-7 2
-8 1
-9 -2
-9 -1
-9 -3
9 3
-9 -4
-9 0
9 2
9 1
6 -3
8 -1
7 -2
5 -4
9 0
4 -5
-9 -6
3 -6
2 -7
-9 -7
-9 -8
-9 -5
1 -8
-4 -9
-5 -9
-3 -9
-6 -9
-2 -9
-7 -9
-1 -9
-8 -9
-9 -9
0 -9
3 -3
-7 -4
-2 1
4 6...

result:

ok There is no valid neighbouring location.

Test #49:

score: 0
Accepted
time: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 6
7 -2
6 -3
9 7
9 8
5 -4
4 -5
8 9
3 -6
7 9
9 9
6 9
5 9
4 9
3 9
2 -7
1 -8
-2 -9
-1 -9
-3 -9
0 -9
-4 -9
-5 -9
2 9
-6 -9
1 9
-3 6
-2 7
-1 8
0 9
-4 5
-5 4
-6 3
-7 -9
-7 2
-8 -9
-8 1
-9 -4
-9 -5
-9 -3
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 -9
-9 0
3 -4
-7 -4
-2 0
4 5
...

result:

ok There is no valid neighbouring location.

Test #51:

score: 0
Accepted
time: 22ms
memory: 5640kb

input:

0 0
1 1
2 2
2 3
2 4
2 5
2 6
2 7
3 7
4 7
5 7
6 7
5 7
6 7
5 7
4 7
5 7
4 7
3 7
2 7
1 7
2 7
1 7
2 7
1 7
2 7
1 7
2 7
1 7
2 7
3 7
4 7
3 7
4 7
5 7
6 7
5 7
4 7
3 7
4 7
3 7
4 7
3 7
2 7
3 7
4 7
5 7
4 7
5 7
6 7
5 7
4 7
5 7
6 7
5 7
6 7
5 7
5 6
5 5
6 5
5 4
6 4
5 3
4 3
5 3
6 3
7 4
6 4
6 5
6 6
6 7
6 8
6 7
7 8
6 7
...

output:

7 7
0 7
9 9
-7 0
4 9
5 9
2 9
3 9
6 9
7 9
8 9
9 8
9 7
9 6
9 5
1 9
-1 8
0 9
-2 7
-3 6
-4 5
-5 4
-6 3
-7 2
-8 1
9 4
-9 -2
-9 -1
-9 -3
-9 -4
9 3
9 2
-9 0
9 1
7 -2
8 -1
6 -3
5 -4
-9 -5
4 -5
3 -6
9 0
-9 -6
-9 -7
2 -7
-9 -8
1 -8
-4 -9
-5 -9
-3 -9
-6 -9
-2 -9
-7 -9
-1 -9
-8 -9
-9 -9
0 -9
3 -3
-7 -4
7 0
3 6
...

result:

ok There is no valid neighbouring location.

Test #52:

score: 0
Accepted
time: 22ms
memory: 7696kb

input:

0 0
-1 0
-2 0
-3 -1
-4 -1
-5 -1
-6 -1
-7 -1
-7 -2
-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 -9
4 9
-1 -9
-3 -9
0 -9
-4 -9
3 9
2 9
1 9
-3 6
-5 -9
-6 -9
-7 -9
-4 5
-6 3
-2 7
-7 2
-1 8
-5 4
0 9
-8 -9
-8 1
-9 -4
-9 -5
-9 -3
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 -9
-9 0
3 -4
-7 -4
-2 0
4 5
...

result:

ok There is no valid neighbouring location.

Test #54:

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

input:

0 0
1 0
1 -1
1 -2
1 -3
1 -4
1 -5
1 -6
2 -5
3 -4
4 -3
3 -4
2 -5
1 -6
2 -5
3 -4
4 -3
5 -2
4 -3
3 -4
2 -5
3 -4
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
3 -4
2 -5
3 -4
4 -3
5 -2
4 -3
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
1 -7
2 -6
1 ...

output:

7 7
7 0
0 -7
4 -5
3 -6
2 -7
1 -8
-1 -9
5 -4
6 -3
7 -2
0 -9
-2 -9
-3 -9
8 -1
9 1
9 2
9 0
9 3
-4 -9
-5 -9
9 4
9 5
9 6
9 7
9 8
7 9
8 9
-6 -9
-7 -9
5 9
9 9
6 9
4 9
3 9
-8 -9
-9 -6
-9 -5
2 9
-9 -7
-9 -3
-9 -8
-9 -9
-9 -4
-9 -2
-9 -1
1 9
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
3 -4
-7 -4
-2 0
4 5...

result:

ok There is no valid neighbouring location.

Test #55:

score: 0
Accepted
time: 30ms
memory: 5636kb

input:

0 0
1 1
1 2
2 3
2 4
3 5
3 6
3 7
4 7
3 7
4 7
5 7
4 7
5 7
4 7
5 7
4 7
3 7
4 7
5 7
4 7
5 7
6 7
5 7
4 7
3 7
2 7
1 7
2 7
1 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9
9 6
9 8
9 7
9 5
9 9
-4 -9
9 4
-3 -9
9 3
-2 -9
9 2
-1 -9
9 1
5 -4
4 -5
6 -3
3 -6
7 -2
2 -7
8 -1
1 -8
0 -9
9 0
0 5
-1 5
3 7
...

result:

ok There is no valid neighbouring location.

Test #57:

score: 0
Accepted
time: 26ms
memory: 9664kb

input:

0 0
0 -1
0 -2
0 -3
0 -4
0 -5
-1 -6
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-5 -7
-...

output:

7 7
7 0
0 -7
0 -9
-1 -9
1 -8
-7 -7
-3 -9
-4 -9
-6 -9
-5 -9
-7 -9
-2 -9
2 -7
-8 -9
-9 -8
-9 -9
-9 -7
3 -6
4 -5
5 -4
-9 -6
-9 -5
-9 -4
6 -3
-9 -3
-9 -2
-9 -1
-7 2
7 -2
-8 1
-6 3
-5 4
-4 5
8 -1
-9 0
9 3
9 4
9 1
9 5
9 0
9 6
9 2
-2 7
9 7
-3 6
-1 8
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #58:

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

input:

0 0
-1 -1
-2 -2
-3 -3
-4 -4
-5 -5
-6 -5
-7 -5
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -5
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -5
-7 -6
-7 -5
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-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 -5
6 -3
3 -6
7 -2
2 -7
8 -1
1 -8
0 -9
9 0
0 5
-1 5
3 7
...

result:

ok There is no valid neighbouring location.

Test #60:

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

input:

0 0
0 1
0 2
0 3
0 4
0 5
1 6
2 7
1 7
2 7
1 7
2 7
3 7
4 7
3 7
4 7
3 7
4 7
5 7
6 7
5 7
4 7
3 7
4 7
3 7
4 7
3 7
4 7
5 7
4 7
5 7
4 7
3 7
4 7
3 7
2 7
3 7
2 7
3 7
4 7
5 7
6 7
5 7
4 7
3 7
2 7
3 7
4 7
3 7
2 7
1 7
2 7
1 7
2 7
1 7
2 7
3 7
2 6
1 6
2 6
3 6
4 7
3 7
3 6
3 5
3 4
2 3
3 3
4 4
4 3
4 2
5 3
5 4
5 3
5 4
...

output:

7 7
-7 0
0 7
0 9
-1 8
1 9
3 9
4 9
2 9
5 9
-2 7
6 9
7 9
8 9
9 8
9 7
9 9
9 6
9 5
9 4
-3 6
-4 5
-5 4
9 3
-6 3
9 2
-7 2
9 1
7 -2
6 -3
8 -1
5 -4
-8 1
9 0
-9 -3
-9 -1
-9 -4
-9 -2
-9 0
4 -5
3 -6
2 -7
-9 -6
-9 -5
-9 -7
-9 -8
1 -8
-4 -9
-5 -9
-3 -9
-6 -9
-2 -9
-7 -9
-1 -9
-8 -9
-9 -9
0 -9
3 -3
-7 -4
-2 1
4 6...

result:

ok There is no valid neighbouring location.

Test #61:

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

input:

0 0
-1 -1
-2 -2
-3 -3
-4 -4
-5 -5
-6 -5
-7 -5
-7 -4
-7 -3
-7 -4
-7 -3
-7 -2
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -5
-7 -6
-7 -5
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -4
-7 -3
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -1
-7 -2
-7 -3
-7...

output:

7 7
0 -7
-7 -7
-9 -9
-9 -8
-8 -9
-7 0
-9 -6
-9 -4
-9 -5
-9 -3
-9 -2
-9 -1
-9 -7
-7 -9
-8 1
-9 0
-7 2
-6 -9
-5 -9
-4 -9
-6 3
-5 4
-4 5
-3 -9
-3 6
-2 -9
-2 7
-1 -9
-1 8
2 -7
2 9
3 -6
3 9
4 -5
1 9
1 -8
4 9
0 -9
5 9
0 9
6 9
6 -3
7 9
5 -4
8 -1
7 -2
8 9
9 5
9 4
9 6
9 3
9 7
9 2
9 8
9 1
9 0
9 9
0 6
-1 5
3 7...

result:

ok There is no valid neighbouring location.

Test #62:

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

input:

0 0
-1 -1
-2 -1
-3 -2
-4 -3
-5 -3
-6 -3
-7 -4
-7 -5
-7 -4
-7 -3
-7 -2
-7 -3
-7 -4
-7 -3
-7 -4
-7 -5
-7 -4
-7 -3
-7 -2
-7 -3
-7 -4
-7 -5
-7 -6
-7 -5
-7 -4
-7 -5
-7 -6
-7 -5
-7 -4
-7 -3
-7 -2
-7 -3
-7 -2
-7 -3
-7 -2
-7 -1
-7 -2
-7 -3
-7 -4
-7 -3
-7 -4
-7 -5
-7 -6
-7 -5
-7 -4
-7 -5
-7 -4
-7 -3
-7 -2
-7...

output:

7 7
0 -7
-7 -7
-7 0
-9 -6
-9 -5
-9 -3
-9 -4
-9 -7
-9 -8
-9 -2
-9 -1
-8 1
-8 -9
-9 0
-7 -9
-9 -9
-6 -9
-7 2
-6 3
-5 4
-5 -9
-4 -9
-3 -9
-2 -9
-4 5
-1 -9
1 -8
3 -6
-3 6
-2 7
-1 8
3 9
2 9
4 9
0 9
1 9
5 9
4 -5
2 -7
5 -4
0 -9
6 -3
7 -2
6 9
7 9
8 -1
8 9
9 5
9 4
9 6
9 3
9 7
9 2
9 8
9 1
9 0
9 9
0 6
-1 5
7 0...

result:

ok There is no valid neighbouring location.

Test #63:

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

input:

0 0
-1 -1
-2 -2
-3 -3
-4 -4
-5 -5
-5 -6
-5 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4...

output:

7 7
0 -7
-7 -7
-9 -9
-9 -8
-8 -9
7 0
-6 -9
-4 -9
-7 -9
-5 -9
-9 -7
-3 -9
-2 -9
-1 -9
1 -8
0 -9
2 -7
-9 -6
-9 -5
-9 -4
-9 -3
-9 -2
3 -6
-9 -1
4 -5
-8 1
5 -4
6 -3
-7 2
7 -2
8 -1
-5 4
9 3
-6 3
9 2
-4 5
9 1
-9 0
9 4
9 5
9 0
9 6
9 7
-3 6
-1 8
-2 7
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #64:

score: 0
Accepted
time: 26ms
memory: 5668kb

input:

0 0
1 0
2 0
3 0
4 0
5 0
6 1
7 2
7 3
7 4
7 5
7 6
7 5
7 4
7 3
7 4
7 3
7 4
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 4
7 5
7 4
7 5
7 4
7 3
7 4
7 3
7 2
7 3
7 4
7 3
7 4
7 3
7 4
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 4
7 3
7 2
7 1
7 2
7 1
7 2
7 1
7 2
7 3
6 3
6 2
7 2
7 1
8 2
7 1
6 1
5 1
6 1
6 2
6 3
6 4
5 3
5 4
5 3
6 4
6 3
5 2
...

output:

7 7
7 0
9 0
8 -1
9 1
7 -2
0 7
9 3
9 4
9 6
9 5
9 8
9 7
9 2
8 9
7 9
9 9
6 9
5 9
4 9
3 9
2 9
6 -3
1 9
5 -4
4 -5
-2 7
3 -6
-3 6
2 -7
1 -8
-1 8
-2 -9
-1 -9
-4 -9
-4 5
-3 -9
-5 4
0 -9
0 9
-6 3
-7 2
-6 -9
-8 -9
-5 -9
-8 1
-7 -9
-9 -4
-9 -5
-9 -3
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 -9
-9 0
3 -4
-7 -4
-2 0
4 5
...

result:

ok There is no valid neighbouring location.

Test #65:

score: 0
Accepted
time: 20ms
memory: 7776kb

input:

0 0
-1 0
-1 1
-2 1
-3 1
-4 1
-4 2
-5 2
-6 1
-5 2
-4 3
-3 4
-4 3
-5 2
-6 1
-5 2
-4 3
-5 2
-4 3
-3 4
-4 3
-5 2
-6 1
-5 2
-4 3
-5 2
-4 3
-5 2
-4 3
-3 4
-2 5
-3 4
-4 3
-3 4
-2 5
-1 6
-2 5
-3 4
-2 5
-3 4
-4 3
-5 2
-6 1
-5 2
-4 3
-3 4
-4 3
-3 4
-4 3
-3 4
-4 3
-5 2
-6 1
-5 2
-6 1
-5 2
-4 3
-5 2
-6 2
-6 1
-...

output:

7 7
-7 -7
-7 0
0 7
-6 3
-7 2
-4 5
-5 4
-8 1
-9 -1
-3 6
-2 7
-9 0
-9 -2
-9 -3
-1 8
1 9
-9 -4
2 9
0 9
3 9
-9 -5
-9 -6
-9 -7
4 9
5 9
6 9
-9 -8
7 9
8 9
9 7
9 6
-6 -9
9 8
9 9
9 5
9 4
-5 -9
9 3
-7 -9
-8 -9
-9 -9
-4 -9
-3 -9
-2 -9
9 2
-1 -9
9 1
5 -4
4 -5
6 -3
3 -6
7 -2
2 -7
8 -1
1 -8
0 -9
9 0
0 5
-1 5
3 7
...

result:

ok There is no valid neighbouring location.

Test #66:

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

input:

0 0
0 -1
0 -2
0 -3
0 -4
1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
3 -6
6 9
5 9
2 -7
4 9
3 9
1 -8
-2 -9
2 9
-3 -9
-4 -9
0 -9
-1 -9
1 9
-2 7
-3 6
-1 8
-4 5
0 9
-5 4
-6 3
-7 2
-6 -9
-5 -9
-7 -9
-8 -9
-8 1
-9 -4
-9 -5
-9 -3
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 -9
-9 0
3 -4
-7 -4
-2 0
4 5
...

result:

ok There is no valid neighbouring location.

Test #68:

score: 0
Accepted
time: 28ms
memory: 5936kb

input:

0 0
-1 -1
-2 -2
-3 -3
-4 -4
-5 -5
-5 -6
-5 -7
-4 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-4 -7
-3 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4...

output:

7 7
0 -7
-7 -7
-9 -9
-9 -8
-8 -9
7 0
-6 -9
-4 -9
-7 -9
-5 -9
-9 -7
-3 -9
-2 -9
-1 -9
1 -8
0 -9
2 -7
-9 -6
-9 -5
-9 -4
-9 -3
-9 -2
3 -6
-9 -1
4 -5
5 -4
-7 2
6 -3
7 -2
8 -1
9 2
-6 3
9 3
-5 4
9 1
-8 1
9 4
-9 0
9 5
9 0
9 6
-3 6
9 7
-4 5
-1 8
-2 7
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #69:

score: 0
Accepted
time: 22ms
memory: 5740kb

input:

0 0
-1 -1
-2 -2
-3 -3
-4 -4
-5 -5
-5 -6
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3 -7
-4 -7
-3 -7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9
-6 -9
9 7
-5 -9
9 6
9 8
9 5
-8 -9
-9 -9
-4 -9
9 4
9 3
-3 -9
9 9
-2 -9
9 2
-1 -9
9 1
5 -4
4 -5
6 -3
3 -6
7 -2
2 -7
8 -1
1 -8
0 -9
9 0
0 5
-1 5
3 7
...

result:

ok There is no valid neighbouring location.

Test #71:

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

input:

0 0
1 0
2 0
3 1
4 1
5 2
6 3
7 4
7 3
7 2
7 1
7 2
7 1
7 2
7 1
7 2
7 1
7 2
7 1
7 2
7 3
7 2
7 3
7 4
7 3
7 2
7 3
7 2
7 1
7 2
7 1
7 2
7 1
7 2
7 3
7 4
7 3
7 4
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 4
7 5
7 6
7 5
7 4
7 3
7 4
7 5
7 4
7 5
7 6
6 6
5 6
5 5
5 4
4 3
3 2
2 1
3 2
4 3
4 2
4 3
5 4
4 3
3 3
3 2
...

output:

7 7
7 0
9 0
0 7
9 3
9 5
9 4
9 6
9 2
9 1
7 -2
8 -1
6 -3
9 7
5 -4
9 8
4 -5
8 9
3 -6
7 9
9 9
6 9
5 9
4 9
3 9
2 -7
1 -8
-2 -9
-1 -9
-3 -9
0 -9
-4 -9
-5 -9
2 9
1 9
-2 7
-4 5
-3 6
0 9
-1 8
-5 4
-6 3
-7 -9
-7 2
-6 -9
-8 -9
-8 1
-9 -4
-9 -5
-9 -3
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 -9
-9 0
3 -4
-7 -4
-2 0
4 5
...

result:

ok There is no valid neighbouring location.

Test #72:

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

input:

0 0
1 0
2 1
3 2
4 2
5 2
6 3
7 4
7 3
7 2
7 3
7 4
7 5
7 6
7 5
7 4
7 5
7 6
7 5
7 4
7 5
7 4
7 5
7 6
7 5
7 4
7 3
7 4
7 3
7 4
7 3
7 4
7 3
7 4
7 3
7 4
7 3
7 2
7 1
7 2
7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1
-9 -4
-9 -5
-9 -3
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 -9
-9 0
3 -4
-7 -4
-2 0
4 5
...

result:

ok There is no valid neighbouring location.

Test #74:

score: 0
Accepted
time: 24ms
memory: 5624kb

input:

0 0
1 0
2 0
2 -1
3 -1
4 -1
4 -2
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
5 -2
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
5 -2
4 -3
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
3 -4
2 -5
1 -6
1 -7
0 -8
-1 -8
-1...

output:

7 7
7 0
9 0
0 -7
5 -4
7 -2
4 -5
6 -3
8 -1
9 2
3 -6
9 1
9 3
9 4
2 -7
1 -8
-1 -9
9 5
-2 -9
9 6
0 -9
-3 -9
-4 -9
-5 -9
9 7
9 8
7 9
8 9
6 9
9 9
-6 -9
-7 -9
-8 -9
5 9
4 9
3 9
-9 -5
2 9
-9 -6
-9 -7
-9 -4
-9 -3
-9 -8
-9 -9
-9 -2
-9 -1
1 9
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
3 -4
-7 -4
-7 -7
3 ...

result:

ok There is no valid neighbouring location.

Test #75:

score: 0
Accepted
time: 20ms
memory: 9888kb

input:

0 0
0 -1
1 -1
1 -2
2 -2
3 -2
4 -2
5 -2
6 -1
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
5 -2
6 -1
5 -2
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
5 -2
4 -3
3 -4
2 -5
3 -4
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
3 -4
2 -5
1 -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
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #77:

score: 0
Accepted
time: 26ms
memory: 9688kb

input:

0 0
0 -1
0 -2
0 -3
0 -4
0 -5
1 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
3 -4
4 -3
3 -4
4 -3
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
5 -2
4 -3
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
1 -5
0 -6
0 -5
-...

output:

7 7
7 0
0 -7
0 -9
-1 -9
1 -8
3 -6
2 -7
4 -5
-2 -9
5 -4
6 -3
7 -2
8 -1
9 1
9 0
9 2
-3 -9
-4 -9
-5 -9
-6 -9
-7 -9
9 3
-8 -9
9 4
-9 -8
9 5
9 6
-9 -7
9 7
9 8
-9 -5
7 9
-9 -6
6 9
-9 -4
5 9
8 9
9 9
-9 -9
-9 -3
-9 -2
3 9
1 9
4 9
-9 -1
2 9
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
3 -4
-7 -4
-2 0
-7 ...

result:

ok There is no valid neighbouring location.

Test #78:

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

input:

0 0
0 -1
0 -2
0 -3
0 -4
0 -5
1 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
3 -4
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
3 -5
2...

output:

7 7
7 0
0 -7
0 -9
-1 -9
1 -8
3 -6
2 -7
4 -5
-2 -9
5 -4
-3 -9
6 -3
7 -2
8 -1
9 1
-4 -9
-5 -9
9 0
9 2
-6 -9
-7 -9
9 3
-8 -9
9 4
-9 -8
9 5
9 6
-9 -7
9 7
9 8
-9 -5
7 9
-9 -6
6 9
-9 -4
5 9
-9 -9
8 9
3 9
4 9
-9 -3
2 9
-9 -2
9 9
-9 -1
1 9
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
6 3
0 3
-1 -5
5 2
-...

result:

ok There is no valid neighbouring location.

Test #79:

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

input:

0 0
0 -1
0 -2
0 -3
0 -4
0 -5
-1 -6
-2 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-1 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-2 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-3 -7
-4 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-6 -7
-5 -7
-4 -7
-5 -7
-...

output:

7 7
7 0
0 -7
0 -9
-1 -9
1 -8
-7 -7
-3 -9
-4 -9
-6 -9
-5 -9
-8 -9
-7 -9
-2 -9
2 -7
-9 -8
-9 -9
-9 -7
3 -6
4 -5
5 -4
-9 -6
-9 -5
-9 -4
6 -3
-9 -3
7 -2
8 -1
-9 -2
-9 -1
9 2
-7 2
9 3
-6 3
9 4
-8 1
9 1
-5 4
9 0
-4 5
-9 0
-3 6
9 6
-2 7
9 5
9 8
9 7
-1 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #80:

score: 0
Accepted
time: 28ms
memory: 5908kb

input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 -9
-2 -9
-7 -9
-9 -7
-1 -9
1 -8
0 -9
2 -7
-9 -6
-9 -5
-9 -4
-9 -3
-9 -2
3 -6
-9 -1
4 -5
-8 1
5 -4
6 -3
-7 2
7 -2
8 -1
-5 4
9 3
-6 3
9 2
-4 5
9 1
-9 0
-3 6
-2 7
9 5
9 6
9 4
9 7
9 0
-1 8
9 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #82:

score: 0
Accepted
time: 25ms
memory: 5596kb

input:

0 0
1 1
2 1
3 2
4 3
5 4
6 4
7 4
7 5
7 4
7 5
7 6
7 5
7 4
7 5
7 4
7 3
7 2
7 1
7 2
7 1
7 2
7 3
7 4
7 5
7 4
7 3
7 2
7 1
7 2
7 1
7 2
7 3
7 4
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 4
7 3
7 2
7 1
7 2
7 1
8 1
8 0
8 1
8 0
8 1
8 2
7 2
6 1
6 0
7 1
6 1
6 0
5 -1
4 -1
3 -2
4 -2
4 -3...

output:

7 7
0 7
7 0
9 5
9 6
9 7
9 4
9 3
9 8
9 2
8 9
9 9
7 9
9 1
6 9
8 -1
9 0
7 -2
6 -3
5 -4
4 -5
3 -6
5 9
4 9
3 9
2 9
2 -7
1 -8
-2 -9
-3 -9
-1 -9
0 -9
-4 -9
1 9
-2 7
-1 8
-3 6
0 9
-4 5
-5 4
-6 3
-7 2
-6 -9
-8 -9
-5 -9
-8 1
-7 -9
-9 -4
-9 -5
-9 -3
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 -9
-9 0
3 -4
-7 -4
-2 0
4 5
...

result:

ok There is no valid neighbouring location.

Test #83:

score: 0
Accepted
time: 25ms
memory: 5728kb

input:

0 0
0 -1
0 -2
0 -3
0 -4
0 -5
1 -5
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
4 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5
6 -3
-9 -4
-9 -3
7 -2
-9 -2
8 -1
-9 -1
9 2
-7 2
9 3
-6 3
9 4
-8 1
9 1
-5 4
9 0
-4 5
-9 0
-3 6
9 6
-2 7
9 5
9 8
9 7
-1 8
5 9
4 9
6 9
3 9
7 9
2 9
8 9
1 9
0 9
9 9
0 5
-1 4
3 6
...

result:

ok There is no valid neighbouring location.

Test #85:

score: 0
Accepted
time: 23ms
memory: 5796kb

input:

0 0
0 -1
0 -2
1 -2
1 -3
2 -3
3 -3
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
4 -3
5 -2
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
3 -4
4 -3
3 -4
4 -3
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
3 -4
4 -3
5 -2
6 -1
5 -1
6...

output:

7 7
7 0
0 -7
4 -5
3 -6
5 -4
6 -3
2 -7
1 -8
-1 -9
-2 -9
0 -9
7 -2
8 -1
9 1
9 0
9 2
9 3
9 4
9 5
9 6
-3 -9
-4 -9
-5 -9
9 7
-6 -9
-7 -9
-8 -9
-9 -7
-9 -8
-9 -6
-9 -9
-9 -5
-9 -4
-9 -3
9 8
5 9
-9 -2
6 9
3 9
7 9
2 9
8 9
4 9
9 9
-9 -1
1 9
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
3 -4
-7 -4
-2 0
4 5...

result:

ok There is no valid neighbouring location.

Test #86:

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

input:

0 0
1 0
2 0
2 -1
3 -1
3 -2
4 -2
4 -3
5 -2
4 -3
3 -4
4 -3
3 -4
4 -3
5 -2
4 -3
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
5 -2
4 -3
5 -2
4 -3
3 -4
2 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4 -5
0 9
1 -8
0 -9
5 -4
6 -3
7 -2
6 9
7 9
5 9
8 -1
8 9
9 5
9 4
9 6
9 3
9 7
9 2
9 8
9 1
9 0
9 9
0 6
-1 5
3 7...

result:

ok There is no valid neighbouring location.

Test #88:

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

input:

0 0
1 0
2 0
3 0
4 0
5 0
6 1
7 2
7 3
7 4
7 5
7 6
7 5
7 4
7 3
7 4
7 3
7 4
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 4
7 5
7 6
7 5
7 4
7 3
7 4
7 3
7 2
7 3
7 2
7 3
7 4
7 3
7 4
7 5
7 6
7 5
7 6
7 5
7 4
7 5
7 4
7 3
7 2
7 1
7 2
7 1
7 2
7 1
7 2
7 3
7 4
6 4
7 5
6 5
5 5
5 4
6 4
5 4
5 3
5 4
6 5
7 6
8 6
7 6
7 5
7 4
7 3
6 2
...

output:

7 7
7 0
9 0
8 -1
9 1
7 -2
0 7
9 3
9 4
9 6
9 5
9 8
9 7
9 2
8 9
7 9
9 9
6 9
5 9
4 9
3 9
2 9
6 -3
1 9
5 -4
4 -5
-2 7
-1 8
-3 6
3 -6
2 -7
-4 5
1 -8
-2 -9
-3 -9
-1 -9
-4 -9
-5 4
0 -9
0 9
-6 3
-7 2
-6 -9
-8 -9
-5 -9
-7 -9
-8 1
-9 -4
-9 -5
-9 -3
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 -9
-9 0
3 -4
-7 -4
-2 0
4 5
...

result:

ok There is no valid neighbouring location.

Test #89:

score: 0
Accepted
time: 18ms
memory: 5712kb

input:

0 0
1 1
2 2
3 3
4 4
5 5
6 5
7 5
7 4
7 3
7 4
7 3
7 4
7 3
7 4
7 3
7 4
7 3
7 2
7 3
7 2
7 3
7 4
7 3
7 4
7 3
7 4
7 3
7 2
7 3
7 2
7 3
7 4
7 3
7 4
7 5
7 4
7 5
7 4
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 4
7 5
7 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2
-1 8
-8 1
-9 0
0 9
3 -4
-7 -4
-2 0
0 7...

result:

ok There is no valid neighbouring location.

Test #91:

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

input:

0 0
1 1
2 1
3 1
4 2
5 2
6 3
7 4
7 5
7 4
7 5
7 4
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 4
7 5
7 4
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 4
7 5
7 6
7 5
7 6
7 5
7 6
7 5
7 4
7 3
7 2
7 3
7 4
7 5
7 6
7 5
7 4
7 5
7 6
7 5
7 4
7 5
7 4
7 5
7 4
7 5
7 4
7 5
8 6
8 7
8 8
7 8
6 8
5 8
4 7
5 8
6 8
7 8
8 8
8 7
7 6
6 6
6 7
5 6
4 5
5 5
...

output:

7 7
0 7
7 0
9 4
9 5
9 3
9 6
9 7
9 8
9 2
8 9
9 9
7 9
6 9
9 1
5 9
8 -1
4 9
7 -2
9 0
3 9
6 -3
2 9
1 9
5 -4
-2 7
4 -5
-1 8
-3 6
3 -6
-4 5
0 9
2 -7
-5 4
-6 3
1 -8
-4 -9
-3 -9
-1 -9
-2 -9
-5 -9
-6 -9
-7 -9
-7 2
0 -9
-8 -9
-8 1
-9 -4
-9 -5
-9 -3
-9 -6
-9 -2
-9 -7
-9 -1
-9 -8
-9 -9
-9 0
3 -4
-7 -4
-2 0
-7 0...

result:

ok There is no valid neighbouring location.

Test #92:

score: 0
Accepted
time: 20ms
memory: 7780kb

input:

0 0
0 -1
0 -2
0 -3
0 -4
0 -5
1 -5
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
4 -3
3 -4
4 -3
5 -2
4 -3
5 -2
6 -1
5 -2
6 -1
5 -2
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
3 -4
4 -3
5 -2
4 -3
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
2 -5
1 -6
2 -5
1 -6
2 -5
1 -6
2 -5
3 -4
3 -5
2 -6
1 -6
1...

output:

7 7
7 0
0 -7
0 -9
-1 -9
1 -8
3 -6
4 -5
2 -7
5 -4
-2 -9
6 -3
7 -2
8 -1
9 1
9 0
9 2
9 3
9 4
9 5
-3 -9
9 6
-4 -9
-5 -9
-6 -9
9 7
-7 -9
9 8
-8 -9
6 9
-9 -7
7 9
-9 -6
8 9
5 9
9 9
-9 -8
-9 -9
-9 -5
-9 -4
-9 -3
2 9
-9 -2
3 9
1 9
4 9
-9 -1
-4 5
-5 4
-3 6
-6 3
-2 7
-7 2
-1 8
-8 1
-9 0
0 9
3 -4
-7 -4
-2 0
4 5...

result:

ok There is no valid neighbouring location.