here is the link to my code https://www.codechef.com/viewsolution/29298815.

# cook your dish here

import math

T = int(input())

for i in range(1, T+1):

finish,distancetoBolt,tigerAcceleration,boltSpeed = input().split(" ")

finish = int(finish)

distancetoBolt = int(distancetoBolt)

tigerAcceleration = int(tigerAcceleration)

boltSpeed= int(boltSpeed)

time_for_bolt = finish/boltSpeed

tiger_distance = distancetoBolt + finish

time_for_tiger = math.sqrt((tiger_distance/tigerAcceleration)*2)

if time_for_bolt == time_for_tiger:

print(‘Tiger’)

elif time_for_bolt > time_for_tiger:

print(‘Tiger’)

else :

print(‘Bolt’)