Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int x1,y1,a,b,x2,y2,aux,aux2;
- bool f = 0;
- cin>>x1>>y1>>x2>>y2>>a>>b;
- if(x1==x2 && y1==y2){
- printf("YES\n");
- }else{
- x1 += a;
- y1 += b;
- aux = x1;
- aux2 = y1;
- if(aux==x2 && aux2==y2){
- f = 1;
- }
- else{ // testa o segundo
- aux = x1;
- aux2 = y1;
- aux = a + aux;
- aux2 = b - aux2;
- if(aux==x2 && aux2==y2){
- f = 1;
- }
- else{ // testa o terceiro
- aux = x1;
- aux2 = y1;
- aux = a - aux;
- aux2 = b + aux2;
- if(aux==x2 && aux2==y2){
- f = 1;
- }
- else{
- aux = x1;
- aux2 = y1;
- aux = a - aux;
- aux2 = b - aux2;
- if(aux==x2 && aux2==y2){
- f = 1;
- }
- }
- }
- }
- if(f) // se chegou no tesouro
- printf("YES\n");
- else
- printf("NO\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement