内存限制:256 MB
时间限制:1 S
题面:Markdown
评测方式:文本比较
上传者:
提交:7
通过:2
There are $n$ monsters in the forest. The $i$\-th one has a defense value of $a_i$.
You can perform the following attacks:
1\. Decrease all monsters' defense values by $1$.
2\. Choose a monster and let its defense value $a_i$ be $\lfloor\frac{a_i}{k}\rfloor$, where $k$ is given.
Find the minimum number of operations required to make the defense value of each monster less than or eqaul to $0$.
Line $1$: Two integers $n,k$.
Line $2$: $n$ integers, indicating sequence $a$.
Line $1$: An integer, the answer.
$1\leq n\leq 10^5$.
$1\leq a_i,k\leq 10^9$.