Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<cstdio>
- #include<cctype>
- #include<iostream>
- #include<fstream>
- #include<functional>
- #include<utility>
- #include<vector>
- #include<stack>
- #include<map>
- #include<queue>
- #include<deque>
- #include<cstdlib>
- #include<cmath>
- #include<algorithm>
- #include<set>
- #include<complex>
- #include<cstring>
- #include<string>
- #include<cassert>
- #include<iomanip>
- using namespace std;
- typedef long long LL;
- typedef unsigned long long ULL;
- typedef vector<int> vi;
- typedef pair<int,int> pii;
- #define pb push_back
- #define mp make_pair
- #define fi first
- #define se second
- #define all(n) (n).begin(), (n).end()
- #define EPS 1e-9
- #define INF 1e9
- #define forn(i, n) for(int i = 0; i < (n); ++i)
- #define forab(i, a, b) for(int i = a; (i) < (b); ++(i))
- #define forba(i, b, a) for(int i = b-1; i >= (a); --i)
- #define forit(i, v) for(__typeof((v).begin()) i = (v).begin(); i != (v).end(); ++i)
- #define fornr(i,n) for(int i=(n)-1;i>=0;--i)
- int x[8], y[8];
- int r[4];
- int D(int a, int b){
- return (x[a]-x[b])*(x[a]-x[b])+(y[a]-y[b])*(y[a]-y[b]);
- }
- int dp(int a, int b, int c, int d){
- return (x[c]-x[a])*(x[d]-x[b])+(y[c]-y[a])*(y[d]-y[b]);
- }
- vi p;
- int main(){
- #ifdef FN
- freopen(FN".in", "r", stdin);
- freopen(FN".out", "w", stdout);
- #endif
- forn(i, 8){
- scanf("%d%d", &x[i], &y[i]);
- p.pb(i);
- }
- do{
- if(D(p[0], p[2])==D(p[1], p[3]) && dp(p[0], p[1], p[2], p[3])==0 && D(p[4], p[5])==D(p[6], p[7]) && D(p[4], p[7])==D(p[5], p[6]) && dp(p[4], p[4], p[5], p[6])==0){
- puts("YES");
- forn(i, 8){
- if(i==4){
- puts("");
- }
- printf("%d", p[i]+1);
- if(i!=3){
- printf(" ");
- }
- }
- return 0;
- }
- }while(next_permutation(p.begin(), p.end()));
- printf("NO\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment