問題一覧 > ⚠未証明/不備あり問題

No.2465 Dilated Water Simulation

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 2
作問者 : 👑 Nachia
お気に入りにしたユーザー ProblemId : 8117 / 自分の提出
問題文最終更新日: 2023-09-09 09:05:06
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 404 (順位表) の他の問題:

About This Problem

Nothing went well, from the recruitment of testers to the contest itself, and there is a high chance that this problem contains flaws; it has therefore been placed among the unproven problems.

Respect

This problem is a version of "Water Simulation", set by noya2, made harder in a simple way.

Problem Statement

There are $L$ containers (container $1$ , container $2$ , $\ldots$ , container $L$ ). The capacity of container $i$ is $V _ i$ . Initially, container $1$ contains water of volume $V _ 1$ , and the other containers contain nothing.

Operation $t$ $(t=1,2,3,\ldots )$ is defined as follows.

  • Let $a=1+((t-1) \bmod L), b=1+(t\bmod L)$ . Pour the water in container $a$ into container $b$ until container $b$ becomes full or container $a$ becomes empty.

Find the amount of water in each container after performing the operations in order from operation $1$ to operation $N$ .

Constraints

  • All values are integers.
  • $4 \leq L \leq 200\, 000$
  • $1 \leq N \leq 10^{18}$
  • $1 \leq V_i \leq 10^{9}$

Input

$L$
$V_1$ $V_2$ $\ldots$ $V_L$
$N$

Output

Find the volumes of water in containers $1,2,\ldots ,L$ after the $N$ operations, and output them in this order, separated by spaces.

Sample

Sample 1
Input
4
31 41 59 26
535897932
Output
26 0 5 0

This has the same meaning as Sample 3 of Water Simulation.

Sample 2
Input
5
12 5 4 3 2
11
Output
4 5 2 1 0

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。