Vasya's favorite supermarket has a special offer: for every $a$ chocolate bars a customer buys, they get $b$ additional bars for free. This offer can be utilized multiple times.
Given the amount of roubles Vasya currently has ($s$), and the cost of each chocolate bar ($c$), your task is to help Vasya calculate the maximum number of chocolate bars he can acquire, including both purchased and free bars.
Input Format
The first line contains an integer $t$ (1 ≤ $t$ ≤ 100) — the number of test cases.
Each of the next $t$ lines contains four integers $s, a, b, c$ (1 ≤ $s, a, b, c$ ≤ $10^9$):
$s$: The total amount of roubles Vasya has.
$a$: The number of chocolate bars Vasya must buy to activate the offer.
$b$: The number of additional chocolate bars received for free.
$c$: The cost of one chocolate bar in roubles.
Output Format
Print $t$ lines, where the $i$-th line contains the maximum number of chocolate bars Vasya can get for the $i$-th test case.
Examples
Input
text
2
10 3 1 1
1000000000 1 1000000000 1
Output
text
13
1000000001000000000
Explanation
In the first test case, Vasya can purchase $9$ bars (with $10$ roubles), which allows him to take $3$ bars for free (due to buying $3$ bars). Thus, he will have $13$ bars in total (9 purchased + 3 free).
In the second test case, Vasya can use all his roubles to buy $1000000000$ bars and receive $1000000000000000000$ free bars, resulting in a total of $1000000001000000000$ bars.
Task
Your solution should be implemented in the /app/ directory.
Important: place your implementation at /app/solution.py so the verifier can run it.