問題一覧 > 通常問題

No.2647 [Cherry 6th Tune A] Wind

レベル : / AI推定難易度 : 183 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 189
作問者 : 👑 Kazun / テスター : hirayuu_yc
お気に入りにしたユーザー ProblemId : 9810 / 自分の提出
問題文最終更新日: 2024-02-23 21:36:11
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 418 (Re: start!) (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。