817A Codeforces - Treasure Hunt





Solution in c++

#include <iostream>
using namespace std;
int Xe,Ye,X1,Y1,x,y;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin >>X1>>Y1>>Xe>>Ye>>x>>y;
    if( (X1-Xe)%x==0 && (Y1-Ye)%y==0 && (abs(X1-Xe)/x)%2 == (abs(Y1-Ye)/y)%2 )cout<<"YES";
    else cout<<"NO";
}

Share on Google Plus

About Mohamed Sobhi

My name is Mo.Sobhy ,I study at School excelling high school in Ain Shams ,Cairo
My hobbies is programming ,and web development ,playing chess and writing horror stories.
    Blogger Comment
    Facebook Comment

0 التعليقات:

إرسال تعليق