QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#61679#2615. Surround the CatBooksnowAC ✓26ms3556kbC++142.8kb2022-11-14 15:52:332022-11-14 15:53:57

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-14 15:53:57]
  • 评测
  • 测评结果:AC
  • 用时:26ms
  • 内存:3556kb
  • [2022-11-14 15:52:33]
  • 提交

answer

#include <bits/stdc++.h>
#define st first
#define nd second
#define db double
#define re register
#define pb push_back
#define mk make_pair
#define int long long
#define ldb long double
#define pii pair<int, int>
#define ull unsigned long long
#define mst(a, b) memset(a, b, sizeof(a))
using namespace std;
const int N = 1e5 + 10, INF = 1e15;
const int bl[54][2] = {{9, 0}, {9, 1}, {9, 2}, {9, 3}, {9, 4}, {9, 5}, {9, 6}, {9, 7}, {9, 8}, {9, 9}, {8, 9}, {7, 9}, {6, 9}, {5, 9}, {4, 9}, {3, 9}, {2, 9}, {1, 9}, {0, 9}, {-1, 8}, {-2, 7}, {-3, 6}, {-4, 5}, {-5, 4}, {-6, 3}, {-7, 2}, {-8, 1}, {-9, 0}, {-9, -1}, {-9, -2}, {-9, -3}, {-9, -4}, {-9, -5}, {-9, -6}, {-9, -7}, {-9, -8}, {-9, -9}, {-8, -9}, {-7, -9}, {-6, -9}, {-5, -9}, {-4, -9}, {-3, -9}, {-2, -9}, {-1, -9}, {0, -9}, {1, -8}, {2, -7}, {3, -6}, {4, -5}, {5, -4}, {6, -3}, {7, -2}, {8, -1}};
inline int read()
{
  int s = 0, w = 1;
  char ch = getchar();
  while(ch < '0' || ch > '9') { if(ch == '-') w *= -1; ch = getchar(); }
  while(ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
bool vis[54], mp[20][20];
inline int dis(int ax, int ay, int bx, int by) //计算位置
{
  //从 (ax,ay) 到 (bx,by) 的最短步数
  int dx = ax - bx, dy = ay - by, res = 0;
  if(dx < 0 && dy < 0) ax -= max(dx, dy), ay -= max(dx, dy), res = abs(max(dx, dy));
  if(dx > 0 && dy > 0) ax -= min(dx, dy), ay -= min(dx, dy), res = abs(min(dx, dy));
  dx = ax - bx, dy = ay - by;
  res = res + abs(dx), res = res + abs(dy);
  return res;
}
inline void query(int x, int y)
{
  int mi = INF, k;
  vector<int> v;
  for(re int i = 0; i < 54; i++){
    if(vis[i]) continue;
    int d = dis(x, y, bl[i][0], bl[i][1]);
    if(d < mi) mi = d, v.clear(), v.pb(i);
    else if(d == mi) v.pb(i);
  }
  mi = INF;
  for(re int i : v){
    int res = 0;
    for(re int j : v) if(i != j) res = res + dis(bl[i][0], bl[i][1], bl[j][0], bl[j][1]);
    if(res < mi) mi = res, k = i;
  }
  vis[k] = true, mp[bl[k][0] + 9][bl[k][1] + 9] = true;
  cout << bl[k][0] << " " << bl[k][1] << "\n", cout.flush();
}
vector<pii> v;
inline void DFS(int x, int y)
{
  if(mp[x + 9][y + 9]) return;
  v.pb(mk(x, y)), mp[x + 9][y + 9] = true;
  DFS(x + 1, y + 1), DFS(x - 1, y - 1);
  DFS(x + 1, y), DFS(x - 1, y), DFS(x, y + 1), DFS(x, y - 1);
}
signed main()
{
  for(re int i = 0, x, y; i < 54; i++) cin >> x >> y, query(x, y); //围起来动不了
  DFS(0, 0);
  while(1){
    int x, y, kx = INF, ky = INF;
    cin >> x >> y;
    for(re pii e : v){
      if((e.st == x && e.nd == y)) continue;
      if(!mp[e.st + 9][e.nd + 9]) continue;
      kx = e.st, ky = e.nd, mp[e.st + 9][e.nd + 9] = false; break;
    }
    if(kx == INF) break;
    cout << kx << " " << ky << "\n", cout.flush();
  }
  return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3316kb

input:

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

result:

ok There is no valid neighbouring location.

Test #3:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #4:

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

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

result:

ok There is no valid neighbouring location.

Test #6:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #7:

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

input:

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

Test #9:

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

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

output:

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

result:

ok There is no valid neighbouring location.

Test #10:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #11:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #12:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #14:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #15:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #17:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #18:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #20:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #21:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #23:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #24:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #25:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #26:

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

result:

ok There is no valid neighbouring location.

Test #28:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #29:

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

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

result:

ok There is no valid neighbouring location.

Test #31:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #32:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #34:

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

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

output:

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

result:

ok There is no valid neighbouring location.

Test #35:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #37:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #38:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #39:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #40:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #41:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #42:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #43:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #45:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #46:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #48:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #49:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #51:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #52:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #54:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #55:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #56:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #57:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #59:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #60:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #62:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #63:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #65:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #66:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #68:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #69:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #70:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #71:

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

result:

ok There is no valid neighbouring location.

Test #73:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #74:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #76:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #77:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #79:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #80:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #82:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #83:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #84:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #85:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #86:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #87:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #88:

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

input:

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

result:

ok There is no valid neighbouring location.

Test #90:

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

input:

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

output:

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

result:

ok There is no valid neighbouring location.

Test #91:

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

input:

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

result:

ok There is no valid neighbouring location.