➽ Problem:-
https://www.hackerrank.com/challenges/kangaroo/problem
➽ Solution:-
#include<iostream>
using
namespace std;
int main()
{
int x1, x2, v1, v2;
cin >> x1 >> v1 >> x2
>> v2;
if(v1>v2 && (x2-x1) % (v1-v2) ==
0)
cout << ("YES")
<<endl;
else
cout << ("NO") <<
endl;
return 0;
}
0 Comments
Please do not enter any spam link in the comment section.