-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathg.cpp
64 lines (57 loc) · 1.11 KB
/
g.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
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
#define fastio ios_base::sync_with_stdio(false)
#define debug(x) cerr << #x << " is " << x << "\n"
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define For(i, n) for(int i=0; i < n; i++)
void solve(){
int x1,x2,x3,y1,y2,y3;
float a,b;
int t;
cin >> t;
while(t--)
{
cin>>x1>>y1>>x2>>y2>>x3>>y3;
if(x1 == x2 && x1 == x3 && y1 == y2 && y2 == y3){
cout << "Possible" << endl;
continue;
}
if(x2==x1)
{
if(x3==x1)
cout<<"Impossible"<<endl;
else{
a=(y3-y1)/(x3-x1);
b=-a*x1+y1;
if(a*x2+b==y2)
cout<<"Impossible"<<endl;
else
cout<<"Possible"<<endl;
}
}
else{
a=(y2-y1)/(x2-x1);
b=-a*x1+y1;
if(a*x3+b==y3)
cout<<"Impossible"<<endl;
else
cout<<"Possible"<<endl;
}
}
}
int main(){
fastio;
freopen("circles.in", "r", stdin);
solve();
return 0;
}