Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 9 点
問題文
うさぎとかめが競走をしています。先に X メートル走った方の勝ちです。
うさぎは秒速 A メートル、かめは秒速 B メートルで走ります。
しかし、うさぎはスタートしてから \frac{X}{2} メートル走った時点で、その場で C 秒間立ち止まって眠ってしまいます。C 秒間経過すると、うさぎは目を覚まして再び秒速 A メートルで走ります。
レースの勝者を求めてください。ただし、同時にゴールする場合はその旨を出力してください。
制約
- 1 \leq X \leq 10000
- 1 \leq A, B \leq 100
- 1 \leq C \leq 10000
- 入力は全て整数
入力
入力は以下の形式で標準入力から与えられる。
X A B C
出力
うさぎが勝つなら Hare
、かめが勝つなら Tortoise
、両者が同時にゴールするなら Tie
と出力せよ。
入力例 1
100 5 3 15
出力例 1
Tortoise
うさぎは 10 秒かけて 50 メートル走り、15 秒眠ったのち、再び 10 秒かけて 50 メートル走ります。合計 35 秒かけてゴールします。
かめは \frac{100}{3} 秒かけてゴールします。
\frac{100}{3} \lt 35 より、かめが勝利します。
入力例 2
240 6 2 80
出力例 2
Tie
両者は同時にゴールします。
入力例 3
10000 100 1 1000
出力例 3
Hare
Score : 9 points
Problem Statement
A hare and a tortoise are in a race. The first to run X meters wins.
The hare runs A meters per second, and the tortoise runs B meters per second.
However, at \frac{X}{2} meters from the start, the hare stops running and sleeps for C seconds. Then, it wakes up and continues running A meters per second.
Find the winner of the race. If the two finish simultaneously, report that fact.
Constraints
- 1 \leq X \leq 10000
- 1 \leq A, B \leq 100
- 1 \leq C \leq 10000
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
X A B C
Output
If the hare wins, print Hare
; if the tortoise wins, print Tortoise
; if the two finish simultaneously, print Tie
.
Sample Input 1
100 5 3 15
Sample Output 1
Tortoise
The hare runs 50 meters in 10 seconds, sleeps for 15 seconds, and again runs 50 meters in 10 seconds, for a total of 35 seconds.
The tortoise finishes the race in \frac{100}{3} seconds.
We have \frac{100}{3} \lt 35, so the tortoise wins.
Sample Input 2
240 6 2 80
Sample Output 2
Tie
The two finish simultaneously.
Sample Input 3
10000 100 1 1000
Sample Output 3
Hare