-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforked.cpp
More file actions
43 lines (43 loc) · 956 Bytes
/
forked.cpp
File metadata and controls
43 lines (43 loc) · 956 Bytes
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
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
long long int a,b,xk,yk,xq,yq;
cin>>a>>b>>xk>>yk>>xq>>yq;
vector<pair<long long int,long long int> > v1;
vector<pair<long long int,long long int> > v2;
v1.push_back({xk-a,yk-b});
v1.push_back({xk-a,yk+b});
v1.push_back({xk+a,yk-b});
v1.push_back({xk+a,yk+b});
v1.push_back({xk-b,yk-a});
v1.push_back({xk+b,yk-a});
v1.push_back({xk+b,yk+a});
v1.push_back({xk-b,yk+a});
v2.push_back({xq-a,yq-b});
v2.push_back({xq-a,yq+b});
v2.push_back({xq+a,yq-b});
v2.push_back({xq+a,yq+b});
v2.push_back({xq+b,yq-a});
v2.push_back({xq-b,yq+a});
v2.push_back({xq+b,yq+a});
v2.push_back({xq-b,yq-a});
// long long int s=0;
set<pair<int,int> >s;
for(int i=0;i<8;i++)
{
for(int j=0;j<8;j++)
{
if(v1[i]==v2[j])
{
s.insert(v1[i]);
}
}
}
cout<<s.size()<<endl;
}
}