QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#508507#2615. Surround the CatZhouShang#AC ✓4ms4116kbC++143.4kb2024-08-07 16:37:412024-08-07 16:37:42

Judging History

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

  • [2024-08-07 16:37:42]
  • 评测
  • 测评结果:AC
  • 用时:4ms
  • 内存:4116kb
  • [2024-08-07 16:37:41]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
vector <pair<int,int>> sp;
map <pair<int,int>,int> id;
int dis[305],xx[305],yy[305],f[305],bd[305];
vector <int> v[305];
int dx[6]={1,0,-1,-1,0,1},dy[6]={1,1,0,-1,-1,0};
void print(int x,int y){
    printf("%d %d\n",x,y);
    fflush(stdout);
}
int main() {
    sp.push_back({8,0}),sp.push_back({9,2}),sp.push_back({9,3}),sp.push_back({8,4});
    sp.push_back({9,6}),sp.push_back({9,7});
    sp.push_back({8,8}),sp.push_back({7,9}),sp.push_back({6,9}),sp.push_back({4,8});
    sp.push_back({3,9}),sp.push_back({2,9});
    sp.push_back({0,8}),sp.push_back({-2,7}),sp.push_back({-3,6}),sp.push_back({-4,4});
    sp.push_back({-6,3}),sp.push_back({-7,2});
    for(int i=0;i<18;i++) sp.push_back({-sp[i].first,-sp[i].second});
    int cnt=0;
    for(int i=9;i>=0;i--)
        for(int j=i-9;j<=9;j++) {
            id[{i, j}] = ++cnt, xx[cnt] = i, yy[cnt] = j;
            if(j==i-9||j==9||i==9) bd[cnt]=1;
        }
    for(int i=-1;i>=-9;i--)
        for(int j=-9;j<=i+9;j++) {
            id[{i, j}] = ++cnt, xx[cnt] = i, yy[cnt] = j;
            if(j==-9||j==i+9||i==-9) bd[cnt]=1;
        }
    for(int i=1;i<=cnt;i++){
        for(int j=0;j<6;j++){
            int tx=xx[i]+dx[j],ty=yy[i]+dy[j];
            if(id.count({tx,ty})) v[i].push_back(id[{tx,ty}]);
        }
    }
    int x=0,y=0;
    while(1){
        scanf("%d%d",&x,&y);
//        cout<<"--->"<<x<<" "<<y<<endl;
        vector <pair<int,int>> must;
        for(int i=0;i<6;i++){
            int tx=x+dx[i],ty=y+dy[i];
            if(id.count({tx,ty})&&f[id[{tx,ty}]]==0){
                if(bd[id[{tx,ty}]]) must.push_back({tx,ty});
            }
        }
        if(must.size()>1){
            return 1;
        }
        if(must.size()==1){
            print(must[0].first,must[0].second);
            f[id[{must[0].first,must[0].second}]]=1;
        }
        else{
            memset(dis,-1,sizeof(dis));
            queue <int> q;
            dis[id[{x,y}]]=0,q.push(id[{x,y}]);
            while(!q.empty()){
                int temp=q.front();
                q.pop();
                for(auto t:v[temp]) if(!f[t]&&dis[t]==-1)
                        dis[t]=dis[temp]+1,q.push(t);
            }
            int ch=-1,mn=INT_MAX;
            for(auto temp:sp){
                if(dis[id[{temp.first,temp.second}]]!=-1&&dis[id[{temp.first,temp.second}]]<mn)
                    mn=dis[id[{temp.first,temp.second}]],ch=id[{temp.first,temp.second}];
            }
            if(ch!=-1){
                print(xx[ch],yy[ch]);
                f[ch]=1;
            }
            else{
                for(int i=1;i<=cnt;i++)
                    if(!f[i]&&(xx[i]!=x||yy[i]!=y)){
                        print(xx[i],yy[i]);
                        f[i]=1;
                        break;
                    }
            }
        }
        int fl=0;
        for(int i=0;i<6;i++){
            int tx=x+dx[i],ty=y+dy[i];
            if(id.count({tx,ty})){
                if(f[id[{tx,ty}]]==0)
                    fl=1;
            }
        }
        if(!fl){
//            puts("WIN!!!");
            break;
        }
//        else{
//            for(int i=0;i<6;i++){
//                int tx=x+dx[i],ty=y+dy[i];
//                if(id.count({tx,ty})&&f[id[{tx,ty}]]==0){
//                    x=tx,y=ty;
////                    break;
//                }
//            }
//        }
    }
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 4ms
memory: 3820kb

input:

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

result:

ok There is no valid neighbouring location.

Test #3:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #4:

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

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

result:

ok There is no valid neighbouring location.

Test #6:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #7:

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

input:

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

Test #9:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #10:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #11:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #12:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #14:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #15:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #17:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #18:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #20:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #21:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #23:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #24:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #25:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #26:

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

result:

ok There is no valid neighbouring location.

Test #28:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #29:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #31:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #32:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #34:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #35:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #37:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #38:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #40:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #41:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #42:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #43:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #45:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #46:

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

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

result:

ok There is no valid neighbouring location.

Test #48:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #49:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #51:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #52:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #54:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #55:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #56:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #57:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #58:

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

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

output:

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

result:

ok There is no valid neighbouring location.

Test #59:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #60:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #62:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #63:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #65:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #66:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #68:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #69:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #71:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #72:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #73:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #74:

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

result:

ok There is no valid neighbouring location.

Test #76:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #77:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #79:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #80:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #82:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #83:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #85:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #86:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #88:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #89:

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

input:

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

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

result:

ok There is no valid neighbouring location.

Test #90:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #91:

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

input:

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

result:

ok There is no valid neighbouring location.