#K40182. Restocking Period Calculation
Restocking Period Calculation
Restocking Period Calculation
You are given an integer n
representing the number of items. For each item, you are provided two integers: the average daily sales a and the restock threshold t.
Your task is to calculate the restocking period for each item. The restocking period is defined as the integer division of the restock threshold by the average daily sales, mathematically represented as:
\(\lfloor\frac{t}{a}\rfloor\)
Output the restocking periods for all items in a single line, separated by spaces.
inputFormat
The input is read from standard input and is structured as follows:
- The first line contains an integer
n
— the number of items. - Then follow
n
lines, each containing two space-separated integers:a
andt
, wherea
is the average daily sales andt
is the restock threshold for that item.
outputFormat
Print a single line containing n
numbers — the restocking periods for each item computed as \(\lfloor t / a \rfloor\). The numbers should be separated by a single space.
3
10 100
5 50
20 200
10 10 10