# PROBLEM LINK:

Practice

Contest: Division 1

Contest: Division 2

Contest: Division 3

Contest: Division 4

* Author, Tester, and Editorialist:* iceknight1093

# DIFFICULTY:

TBD

# PREREQUISITES:

None

# PROBLEM:

Chef needs L minutes to write one page with his left hand, and R minutes to type one line of code with his right.

His satisfaction is the number of pages he started writing, plus the number of lines of code he finished typing.

Find Chef’s satisfaction after M minutes.

# EXPLANATION:

In M minutes,

- Chef will have started writing \left\lceil \frac{M}{L} \right\rceil pages; and
- Chef will have finished typing \left\lfloor \frac{M}{R} \right\rfloor lines of code

Here, \left\lceil \ \right\rceil and \left\lfloor \ \right\rfloor denote the floor and ceiling functions, respectively.

Putting them together, the answer is

\left\lceil \frac{M}{L} \right\rceil + \left\lfloor \frac{M}{R} \right\rfloor

# TIME COMPLEXITY

\mathcal{O}(1) per testcase.

# CODE:

## Editorialist's code (Python)

```
for _ in range(int(input())):
L, R, M = map(int, input().split())
print((M+L-1)//L + M//R)
```