-
Notifications
You must be signed in to change notification settings - Fork 4
/
ADASHOP2.cpp
73 lines (67 loc) · 1.67 KB
/
ADASHOP2.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main()
{
int test;
cin>>test;
if (test>0 || test<33)
{
while(test--)
{
int x,y;
cin>>x>>y;
if(x<0 || x>9 || y<0 || y>9 || (x+y)%2!=0 )
{
continue;
}
vector<pair<int,int>> pts;
pts.push_back(make_pair((x+y)/2,(x+y)/2));
pts.push_back(make_pair(1,1));
for(int i=1;i<4;i++)
{
pts.push_back(make_pair(i+1,i+1));
pts.push_back(make_pair(1,(2*i)+1));
pts.push_back(make_pair((2*i)+1,1));
pts.push_back(make_pair(i+1,i+1));
}
for(int i=1;i<4;i++)
{
pts.push_back(make_pair(i+4,i+4));
pts.push_back(make_pair(8,2*i));
pts.push_back(make_pair(2*i,8));
pts.push_back(make_pair(i+4,i+4));
}
pts.push_back(make_pair(8,8));
if(x!=y)
{
printf("26\n");
for(int i=0;i<pts.size()-1;i++)
{
printf("%d %d\n",pts[i+1].first,pts[i+1].second);
}
}
else if(x==1 &&y==1)
{
printf("25\n");
for(int i=1;i<pts.size()-1;i++)
{
printf("%d %d\n",pts[i+1].first,pts[i+1].second);
}
}
else
{
printf("25\n");
for(int i=0;i<pts.size()-1;i++)
{
printf("%d %d\n",pts[i+1].first,pts[i+1].second);
}
}
}
}
else
{
return 0;
}
return 0;
}