CF1471A Strange Partition
题目描述
给定一个长度为 $n$ 的数组 $a$ 和 一个整数 $x$,可以进行任意多次以下操作:将当前数组中 **相邻** 的两个数用他们的 **和** 替换掉。
定义一个长度为 $k$ 的数组 $b$ 的美丽度是:
$$\sum\limits_{i=1}^k{\lceil\frac{b_i}{x}\rceil}$$
现在求能对原数组经过若干次变换得到的数组的 **最小美丽度** 和 **最大美丽度**
输入格式
第一行一个整数 $T$ ,表示 $T$ 组数据。
每组数据:
第一行两个整数 $n,x$
第二行 $n$ 个整数表示 $a$
数据保证:
* $\sum {n} \leq 10^5$
* $a_i, x \leq 10^9$
* $T \leq 1000$
输出格式
共 $T$ 行,每行两个数,分别表示题面中的 **最小美丽度** 和 **最大美丽度**。
说明/提示
In the first test case the beauty of the array does not change if we perform any operations.
In the second example we can leave the array unchanged to attain the maximum beauty, and to get the minimum beauty one can replace two elements $ 4 $ and $ 11 $ with their sum, yielding an array $ [6, 15] $ , which has its beauty equal to $ 7 $ .