Created
July 14, 2020 06:51
-
-
Save Abhayparashar31/65a57986fc9ff58332c1e029140d3f9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import os | |
import random | |
import re | |
import sys | |
# Complete the kangaroo function below. | |
def kangaroo(x1, v1, x2, v2): | |
for n in range(10000): | |
if((x1+v1)==(x2+v2)): | |
return "YES" | |
x1+=v1 | |
x2+=v2 | |
return "NO" | |
if __name__ == '__main__': | |
fptr = open(os.environ['OUTPUT_PATH'], 'w') | |
x1V1X2V2 = input().split() | |
x1 = int(x1V1X2V2[0]) | |
v1 = int(x1V1X2V2[1]) | |
x2 = int(x1V1X2V2[2]) | |
v2 = int(x1V1X2V2[3]) | |
result = kangaroo(x1, v1, x2, v2) | |
fptr.write(result + '\n') | |
fptr.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment