Cab and Walk
import math
user_input = input()
data = user_input.split(" ")
N = int(data[0])
V1 = int(data[1])
V2 = int(data[2])
walking_distance = (2 - math.sqrt(N))*(2 * N)
walking_time = walking_distance/V1;
cab_distance = 2 * ((2 - math.sqrt(N))*(2 * N))
cab_time = cab_distance/V2;
if(walking_time < cab_time):
print("Walk")
else:
print("Cab")
Thanks for posting. Its an Important topic to be read.
ReplyDeletePython Online Training