(x1, v1, x2, v2)
| 6 | The second condition is where we equate x1 + v1*t = x2 + v2*t. as the time should be greater then 0, the resulting condition is (x1-x2)/(v2-v1) > 0 |
| 7 | """ |
| 8 | def kangaroo(x1, v1, x2, v2): |
| 9 | if v1==v2: |
| 10 | return "NO" |
| 11 | if (x1-x2)/(v2-v1)>0: |
| 12 | var=float(x1-x2)/float(v2-v1) |
| 13 | if var - int(var) ==0: |
| 14 | return "YES" |
| 15 | else: |
| 16 | return "NO" |
| 17 | else: |
| 18 | return "NO" |
| 19 | |
| 20 | if __name__ == '__main__': |
| 21 | fptr = open(os.environ['OUTPUT_PATH'], 'w') |