Codeforces Round #261 (Div. 2) 459A - Pashmak and Garden Solution
Solution in C++:
///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///Abul Hasnat Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int x1,x2,y1,y2;
cin>>x1>>y1>>x2>>y2;
if(x1==x2)
cout<<y1-y2+x1<<" "<<y1<<" "<<y1-y2+x2<<" "<<y2<<endl;
else if(y1==y2)
cout<<x1<<" "<<y1+x1-x2<<" "<<x2<<" "<<y2+x1-x2<<endl;
else if(abs(x1-x2)==abs(y1-y2))
cout<<x1<<" "<<y2<<" "<<x2<<" "<<y1<<endl;
else
cout<<"-1"<<endl;
return 0;
}
No comments