You are viewing a single comment's thread. Return to all comments →
i think this will help....
using namespace std;
int main(){ int x1; int v1; int x2; int v2; cin >> x1 >> v1 >> x2 >> v2; if((x1>x2&&v1v2)){ double remainder; remainder = abs(x1-x2)%abs(v2-v1); if (remainder==0.0){ cout<<"YES"; return 0; }
} cout<<"NO"; return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →
i think this will help....
include
include
using namespace std;
int main(){ int x1; int v1; int x2; int v2; cin >> x1 >> v1 >> x2 >> v2; if((x1>x2&&v1v2)){ double remainder; remainder = abs(x1-x2)%abs(v2-v1); if (remainder==0.0){ cout<<"YES"; return 0; }
}