Gahui and the 4-Hour Wall 2
Time limit1sMemory limit512 MB
Given the rail time S and the flight legs Ma, Fab, and Mb, decide whether most passengers at station a take high speed rail or a flight.
- Level
Easy2 of 10
- Topics
- Implementation
- Solved
- No attempts yet
Problem
The 4-hour wall is the tendency where, when high speed rail and flights compete, high speed rail is superior on routes it covers in hours or less, and otherwise flights are superior. When a passenger travels on route , the passenger takes high speed rail if at least one of the two conditions below holds. Otherwise, the passenger takes a flight.
- When traveling on route , the flight takes the same time or longer than high speed rail.
- Passenger likes trains. Also, high speed rail covers route in hours or less.
Traveling from station to station by high speed rail takes minutes. Traveling from station to station by flight takes the sum of the following:
- minutes from station to airport
- minutes from airport to airport
- minutes from airport to station
People who use station include more people who like trains. For people who use station and travel from station to station , report which transportation mode is used more.
Input
The first line contains as described in the problem.
The second line contains , , and as described in the problem, separated by spaces.
Output
If people who use station use high speed rail more when traveling from station to station , print high speed rail. Otherwise, print flight.
Constraints
- Every travel time is at least minute and at most minutes.
- High speed rail and flights depart on time and arrive on time.