I found an interesting problem on https://www.codechef.com/problems/SEBIHWY:
Sebi goes to school daily with his father. They cross a big highway in the car to reach to the school. Sebi sits in front seat beside his father at driving seat. To kill boredom, they play a game of guessing speed of other cars on the highway. Sebi makes a guess of other car's speed being SG kph, his father FG kph. 

The highway is usually empty, so the drivers use cruise control, i.e. vehicles run at a constant speed. There are markers on the highway at a gap of 50 meters. Both father-son duo wants to check the accuracy of their guesses. For that, they start a timer at the instant at which their car and the other car (which speed they are guessing) are parallel to each other (they need not to be against some marker, they can be in between the markers too). After some T seconds, they observe that both the cars are next to some markers and the number of markers in between the markers of their car and the other car is D - 1 (excluding the markers next to both the cars). Also, they can observe these markers easily because the other car is faster than their. Speed of Sebi's father's car is S. Using this information, one can find the speed of the other car accurately.

An example situation when Sebi's father starts the timer. Notice that both the car's are parallel to each other.

Example situation after T seconds. The cars are next to the markers. Here the value of D is 1. The green car is Sebi's and the other car is of blue color.

Sebi's a child, he does not know how to find the check whose guess is close to the real speed of the car. He does not trust his father as he thinks that he might cheat. Can you help to resolve this issue between them by telling whose guess is closer. If Sebi's guess is better, output "SEBI". If his father's guess is better, output "FATHER". If both the guess are equally close, then output "DRAW".

-----Input-----
The first line of the input contains an integer T denoting the number of test cases. 
Each of the next T lines contain five space separated integers S, SG, FG, D, T...

I tried it in Python, but could not do it. Can you solve it?
# cook your dish here
n=int(input())
for i in range(n):
    S, SG, FG, D, T = map(int, input().split())
    speed = (D*180)/T + S
    if abs(SG-speed) == abs(FG-speed):
        print('DRAW')
    elif abs(SG-speed) > abs(FG-speed):
        print('FATHER')
    else:
        print('SEBI')