CF985C Liebig's Barrels
题目描述
你有一共m=n*k个木板。第i个木板的长度为ai。你必须用其中的每k条木板组成n个木桶。每条木板只能且必须属于一个木桶。我们把第j个木桶的最短的木板长度作为这个木桶的容积vj
你想要让这组合起来的n个木桶总容积最大。但是你需要让他们的容积尽量差不多,使得无论那两个木桶的容积差不超过l,即|vx-vy|
输入格式
无
输出格式
无
说明/提示
In the first example you can form the following barrels: $ [1,2] $ , $ [2,2] $ , $ [2,3] $ , $ [2,3] $ .
In the second example you can form the following barrels: $ [10] $ , $ [10] $ .
In the third example you can form the following barrels: $ [2,5] $ .
In the fourth example difference between volumes of barrels in any partition is at least $ 2 $ so it is impossible to make barrels equal enough.