시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 256 MB | 9 | 6 | 6 | 66.667% |
Maggy makes some extra money by knitting scarves. Today she got lucky -- a merchant made an offer for as many scarves as possible, under one condition, though -- he wants only scarves of the same length, counted in the number of rows (otherwise they look bad in the store). He announced that he would return shortly, after exactly $k$ moments. Maggy knows the current lengths of all scarves and both stitching and unravelling a row takes her one moment. Help Maggy -- compute how many scarves of equal length she can produce.
The first line of the input contains two integers $n$ and $k$ ($ 1 \leq n \leq 10^5$, $0 \leq k \leq 10^9$), separated by a single space, denoting the number of scarves and the number of moments after which the merchant will return. In the second and last line of the input there are $n$ natural numbers $a_i$ ($1 \leq a_i \leq 10^9$), each separated by a single space. These are the lengths of consecutive scarves, counted in the number of rows.
You should write one integer number in the first and only line of the output -- the maximum number of scarves of equal length that Maggy can produce before the merchant returns.
5 6 1 2 3 4 4
5
In $6$ moments Maggy can make the lengths of all scarves equal to $2$.