The Leaky Tank
Time: 1 s
Memory: 125 MB
Memory: 125 MB
Ubaid is trying to fill up an empty water tank using a water pump. The pump pours exactly \(\boldsymbol{5}\) liters of water into the tank every second. But there's a problem: the tank has a leak and constantly drains \(\boldsymbol{2}\) liters of water per second. Despite the leak, Ubaid is determined to fill the tank with at least \(\boldsymbol{X}\) liters of water.
Given the target \(\boldsymbol{X}\), help Ubaid determine the minimum number of seconds required to reach or exceed \(\boldsymbol{X}\) liters in the tank.
Given the target \(\boldsymbol{X}\), help Ubaid determine the minimum number of seconds required to reach or exceed \(\boldsymbol{X}\) liters in the tank.
Input
The first line contains an integer \(\boldsymbol{T}\) — the number of test cases.Each of the next \(\boldsymbol{T}\) lines contains a single integer \(\boldsymbol{X}\) — the desired amount of water in liters for that test case.
Constraint
\(\boldsymbol{1 \leq T \leq 10^5}\)\(\boldsymbol{1 \leq X \leq 10^9}\)
Output
For each test case, print a single integer — the minimum number of seconds required to reach or exceed \(\boldsymbol{X}\) liters of water in the tank.
Examples
| Input | Output |
|---|---|
|
4
5 9 17 247 |
2
3 6 83 |
Problem Info
| Problem ID | 495 |
| Time Limit | 1000 ms |
| Memory Limit | 128000 KB |
| Moderators | heyubayed , muhimin , mahdi_talukder , Royboy01 |
Statistics
Submit
You need to Login or Registration for submit your solution