#P38C. Blinds
Blinds
机翻
众所周知,百叶窗由不透明的水平条纹组成,可以旋转,从而调节房间里的光线流量。有 n工厂仓库里有宽度为1的百叶窗条,用于生产百叶窗。问题是,它们都是来自不同订单的备用细节,也就是说,它们可能没有相同的长度(甚至有可能有不同的长度)。
每条条纹都可以被切割成两个或更多的部分。剪切的时候要垂直于测量长度的一侧。因此,剪裁不会改变条纹的宽度,但所产生的每一块都有一个较小的长度(其总和等于初始条纹的长度)。
在所有的剪裁之后,百叶窗是通过连续连接几个长度相近的部分,沿着边上的长度进行测量而形成的。此外,除了所产生的部分,如果初始条纹没有被切割,也可以作为百叶窗使用。禁止以任何其他方式建造百叶窗。
因此,如果百叶窗是由 块,每块 长,那么它们的形式就是一个长方形的 bourlemeters。
你的任务是,如果从技术上讲,禁止使用短于bourlemeter的木片,那么你要找出哪扇窗户拥有最大的面积,可以用给定的木片制作百叶窗。 lbourlemeter。窗户的形状是一个边长为正整数的矩形。
第一行输出包含两个隔开空间的整数 n 和 l (1 ≤ n, l ≤ 100).它们是仓库中的条纹数量和盲条纹的最小可接受长度,单位是波尔米。第二行包含用空格分隔的 n 整数 它们是初始条纹的长度,单位是bourlemeters ().
打印单个数字--可以完全覆盖的窗口的最大面积,单位是平方布尔米。如果没有一个正面积的窗口可以在不违反任何给定规则的情况下被完全覆盖,那么就打印单数0 。
Description
The blinds are known to consist of opaque horizontal stripes that can be rotated thus regulating the amount of light flowing in the room. There are n blind stripes with the width of 1 in the factory warehouse for blind production. The problem is that all of them are spare details from different orders, that is, they may not have the same length (it is even possible for them to have different lengths)
Every stripe can be cut into two or more parts. The cuttings are made perpendicularly to the side along which the length is measured. Thus the cuttings do not change the width of a stripe but each of the resulting pieces has a lesser length (the sum of which is equal to the length of the initial stripe)
After all the cuttings the blinds are constructed through consecutive joining of several parts, similar in length, along sides, along which length is measured. Also, apart from the resulting pieces an initial stripe can be used as a blind if it hasn't been cut. It is forbidden to construct blinds in any other way.
Thus, if the blinds consist of k pieces each d in length, then they are of form of a rectangle of k × d bourlemeters.
Your task is to find for what window possessing the largest possible area the blinds can be made from the given stripes if on technical grounds it is forbidden to use pieces shorter than l bourlemeter. The window is of form of a rectangle with side lengths as positive integers.
The first output line contains two space-separated integers n and l (1 ≤ n, l ≤ 100). They are the number of stripes in the warehouse and the minimal acceptable length of a blind stripe in bourlemeters. The second line contains space-separated n integers ai. They are the lengths of initial stripes in bourlemeters (1 ≤ ai ≤ 100).
Print the single number — the maximal area of the window in square bourlemeters that can be completely covered. If no window with a positive area that can be covered completely without breaking any of the given rules exist, then print the single number 0.
Input
The first output line contains two space-separated integers n and l (1 ≤ n, l ≤ 100). They are the number of stripes in the warehouse and the minimal acceptable length of a blind stripe in bourlemeters. The second line contains space-separated n integers ai. They are the lengths of initial stripes in bourlemeters (1 ≤ ai ≤ 100).
Output
Print the single number — the maximal area of the window in square bourlemeters that can be completely covered. If no window with a positive area that can be covered completely without breaking any of the given rules exist, then print the single number 0.
Samples
4 2
1 2 3 4
8
5 3
5 5 7 3 1
15
2 3
1 2
0
Note
在第一个测试样本中,所需的窗户大小为2 × 4 ,其百叶窗由4个部分组成,每个部分长2英寸。其中一个部分是长度为2的初始条纹,另一个是长度为3的切割条纹的一部分,剩下的两个条纹是长度为4的切割条纹的一部分。
In the first sample test the required window is 2 × 4 in size and the blinds for it consist of 4 parts, each 2 bourlemeters long. One of the parts is the initial stripe with the length of 2, the other one is a part of a cut stripe with the length of 3 and the two remaining stripes are parts of a stripe with the length of 4 cut in halves.