No.2647 [Cherry 6th Tune A] Wind
タグ : / 解いたユーザー数 189
作問者 : 👑
Kazun
/ テスター :
Problem Statement
There is an anemometer on the roof of Sakura High School, and the wind force of $1$ day is determined using this anemometer.
Specifically, when the propeller of the anemometer rotates $x$ times during $1$ day, the wind force of that day is defined as the integer obtained by rounding $\dfrac{x}{A}$ to the nearest integer, rounding half up at the first decimal place.
There is a record of the number of rotations of the anemometer's propeller over a certain period of $D$ consecutive days. On day $d~(1 \leq d \leq D)$, the propeller of the anemometer rotated $X_d$ times.
Find the wind force on each day.
Solve $T$ test cases.
Constraints
- $1 \leq T \leq 100$.
- Constraints for each test case
- $1 \leq D \leq 100$.
- $1 \leq A \leq 10^{18}$.
- $0 \leq X_d\leq 10^{18} \quad (1 \leq d \leq D)$.
- All inputs are integers.
Input
$T$
${\rm case}_1$
$\vdots$
${\rm case}_T$
Each test case is given in the following format.
$D$ $A$ $X_1$ $X_2$ $\cdots$ $X_D$
Output
The output consists of $T$ lines. On line $t~(1 \leq t \leq T)$, output the answer to the $t$-th test case in the following format.
-
Let $P_d$ be the wind force on day $d~(1 \leq d \leq D)$. Output $P_1, P_2, \dots, P_D$ on $1$ line, separated by spaces.
Specifically, output in the following format.
$P_1$ $P_2$ $\cdots$ $P_D$
Do not forget the newline at the end.
Sample
Sample 1
Input
2 3 10 83 99 15 1 987654321 998877665544332211
Output
8 10 2 1011363636
We explain the $1$st test case.
- The wind force on day $1$ is $8$, the integer obtained by rounding $\dfrac{83}{10}=8.3$ to the nearest integer.
- The wind force on day $2$ is $10$, the integer obtained by rounding $\dfrac{99}{10}=9.9$ to the nearest integer.
- The wind force on day $3$ is $2$, the integer obtained by rounding $\dfrac{15}{10}=1.5$ to the nearest integer.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。