-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkangaroo
More file actions
54 lines (40 loc) · 726 Bytes
/
kangaroo
File metadata and controls
54 lines (40 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include<iostream>
#include<math.h>
#include<cstdlib>
using namespace std;
int main()
{
int x1,v1,x2,v2;
float y;
cin>>x1>>v1>>x2>>v2;
// int flag=1;
if(v1!=v2)
y=(float)(x2-x1)/(v1-v2);
else{
cout<<"NO";
exit(1);}
if(y<0)
cout<<"NO";
else{
if(y==floor(y))
{
cout<<"YES";}
else
cout<<"NO";}
/* do
{
x1=x1+v1;
x2=x2+v2;
if(x1==x2)
{
flag=0;
break;
}
}while(flag==1);
if(flag==0)
cout<<"YES";
if(flag==1)
cout<<"NO";
*/
return 0;
}