# PROBLEM LINK:

Practice

Contest: Division 1

Contest: Division 2

Contest: Division 3

Contest: Division 4

* Author:* Pratiyush MIshra

*Harris Leung*

**Tester:***Nishank Suresh*

**Editorialist:**# DIFFICULTY:

TBD

# PREREQUISITES:

None

# PROBLEM:

Chef is on floor A and can run down X floors a minute. Chefina is on floor B and can run down Y floors a minute. Who reaches the ground floor faster?

# EXPLANATION:

The time taken equals distance divided by speed.

So,

- Chef takes \frac{A}{X} minutes to reach the ground floor.
- Chefina takes \frac{B}{Y} minutes to reach the ground floor.

Compute these two values, and then compare them.

- If they are equal, the answer is â€śBothâ€ť.
- If \frac{A}{X} is smaller, the answer is â€śChefâ€ť
- Otherwise, the answer is Chefina.

# TIME COMPLEXITY

\mathcal{O}(1) per test case.

# CODE:

## Editorialist's code (Python)

```
for _ in range(int(input())):
a, b, x, y = map(int, input().split())
if a*y == b*x:
print('Both')
elif a*y > b*x:
print('Chefina')
else:
print('Chef')
```