Luba thinks about watering her garden. The garden can be represented as a segment of length k. Luba has got n buckets, the i-th bucket allows her to water some continuous subsegment of garden of length exactly ai each hour. Luba can't water any parts of the garden that were already watered, also she can't water the ground outside the garden.
Luba has to choose one of the buckets in order to water the garden as fast as possible (as mentioned above, each hour she will water some continuous subsegment of length ai if she chooses the i-th bucket). Help her to determine the minimum number of hours she has to spend watering the garden. It is guaranteed that Luba can always choose a bucket so it is possible water the garden.
See the examples for better understanding.
Input
The first line of input contains two integer numbers n and k (1 ≤ n, k ≤ 100) — the number of buckets and the length of the garden, respectively.
The second line of input contains n integer numbers ai (1 ≤ ai ≤ 100) — the length of the segment that can be watered by the i-th bucket in one hour.
It is guaranteed that there is at least one bucket such that it is possible to water the garden in integer number of hours using only this bucket.
Output
Print one integer number — the minimum number of hours required to water the garden.
Examples
Input
3 6
2 3 5
Output
2
Input
6 7
1 2 3 4 5 6
Output
7
Note
In the first test the best option is to choose the bucket that allows to water the segment of length 3. We can't choose the bucket that allows to water the segment of length 5 because then we can't water the whole garden.
In the second test we can choose only the bucket that allows us to water the segment of length 1.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
We are given: n buckets, each bucket allows watering a continuous subsegment of length exactly a_i each hour. Luba must choose one bucket (i.e., she will use the same bucket for all hours) and water the garden (segment of length k). She cannot water already watered parts, nor outside. So effectively she must cover the segment [0, k) with disjoint intervals of length a_i (exactly) placed consecutively (since she can only water a continuous subsegment each hour, and cannot overlap, and must cover the entire garden exactly). She must choose a bucket such that k is a multiple of a_i? Wait, not exactly. Let's read carefully: "each hour she will water some continuous subsegment of length exactly a_i if she chooses the i-th bucket." She can choose which subsegment to water each hour, as long as it's a continuous subsegment of the garden of length a_i, and she cannot water any parts that were already watered, nor outside. So she must partition the garden into pieces of length a_i? However, does it need to be exactly a_i? Yes, each hour she waters a subsegment of length exactly a_i. So she must cover the entire garden with a set of disjoint intervals each of length a_i, and these intervals together cover exactly the garden, with no gaps? Because she cannot water outside, and she must water the whole garden. She can choose any continuous subsegment each hour, so she can decide the order. However, if a_i does not divide k exactly, can she still cover? Suppose k=6, a_i=4. With intervals of length 4, can we cover length 6? Two intervals of length 4 would overlap by 2, which is not allowed because cannot water already watered parts. So you can't have overlapping. You could water first an interval of length 4 covering [0,4), then you need to cover [4,6) but length 4 would go outside garden; you could water [2,6) which is length 4 but that would overlap with [0,4) in [2,4). Not allowed. So you cannot cover exactly a segment of length k with intervals of length a_i if a_i does not divide k. But there is a twist: maybe she can skip some parts and water them later? No, she must water the whole garden eventually; she cannot leave gaps because that would be unwatered. So the intervals must cover the garden without overlap and no gaps. Since intervals are all length a_i, the union must be exactly the garden. Therefore, it's necessary that a_i divides k (k % a_i == 0) and the intervals are placed consecutively, e.g., first [0, a_i), then [a_i, 2a_i), etc. That yields exactly k/a_i hours. However, is it possible to place intervals not aligned to the start? Could you place intervals that are not exactly aligned to the start but still cover without gaps? Consider k=6, a_i=4. Could we do: first hour water [1,5) (length 4)? That covers positions 1-4. Then we need to cover [0,1) and [5,6). But the next interval must be length 4 and cannot overlap. There is no interval of length 4 that covers those uncovered parts without overlapping. So not possible. In general, covering a segment of length k with intervals of equal length L requires that k is a multiple of L if they are non-overlapping and cover exactly, because the total length covered is mL, and it must equal k; also intervals must be placed consecutively to avoid gaps? Actually, if you allow intervals to be placed at arbitrary positions, you can still achieve total length = mL = k, but you also need to avoid overlaps and gaps. If L doesn't divide k, you could have intervals that are not contiguous? But they must collectively cover every point in [0,k] exactly once. This is a tiling of the segment by intervals of equal length. It's known that a tiling of an interval by intervals of equal length (closed intervals) requires that length divides the total length. Because if you have a tiling of [0,k] by intervals of length L, then consider the leftmost interval. Its left endpoint must be 0? Possibly not: you could start at some offset, but then the uncovered left part would have to be covered by another interval, which would have to start somewhere else. But can we tile a segment of length 6 with intervals of length 4 and 2? No, but we only have length 4 intervals. So think: Suppose we have intervals of length L. They are closed intervals? Typically continuous subsegment. Suppose we have two intervals I1 = [x1, x1+L], I2 = [x2, x2+L], with x1 < x2. They must be disjoint and cover [0,k]. So we need 0 ≤ x1, x1+L ≤ x2 (since no overlap), and the union must cover from 0 to k. So the leftmost interval must start at ≤0? Actually, you can't water outside the garden, so intervals must be fully inside [0,k]. So x1 ≥ 0, x1+L ≤ k. For covering, the leftmost point of the garden, 0, must be covered by some interval. So there must be an interval starting at ≤0? But starting at <0 is not allowed because must be inside garden. So the interval covering 0 must start at ≤0, but since it must be inside, its left endpoint must be exactly 0. Because if it starts >0, then [0, start) is uncovered and cannot be covered by any other interval without overlapping because the other intervals would have to start before 0 or something. Actually, could there be an interval that covers 0 but starts negative? No, because outside garden is not allowed. So the only way an interval can cover 0 is if its left endpoint is exactly 0. So the leftmost interval must start at 0. Similarly, the rightmost interval must end at k. So the first interval is [0, L]. Then the next interval must start at L to avoid a gap (since if it starts > L, there is a gap (L, start)). To avoid gaps, it must start exactly at L. By induction, we get intervals [0, L], [L, 2L], ..., [(m-1)L, mL] with mL = k. So indeed k must be divisible by L. So the condition is k % a_i == 0. Then the number of hours is k / a_i.
But the problem statement says: "It is guaranteed that Luba can always choose a bucket so it is possible water the garden." That means at least one bucket satisfies k % a_i == 0. And we need the minimum number of hours, which is min over i of (k / a_i) for those i where a_i divides k.
So solution: For each a_i, if k % a_i == 0, compute hours = k / a_i; keep minimal. Output that.
Constraints up to 100, trivial.
Thus answer.
But I'd like to double-check if there is any alternative interpretation? Possibly she can choose different buckets? The problem says: "Luba has to choose one of the buckets in order to water the garden as fast as possible (as mentioned above, each hour she will water some continuous subsegment of length ai if she chooses the i-th bucket)." So she must stick to one bucket. So yes.
Edge cases: maybe a_i > k? She cannot use it because she would have to water a segment of length a_i which is longer than the garden, and she can't water outside, so it's not allowed. The problem says: "also she can't water the ground outside the garden." So if a_i > k, she cannot use that bucket because she would have to water a subsegment of length exactly a_i, but any subsegment of the garden has max length k. So it's impossible. However, they guarantee there is at least one bucket that works. So we need to exclude those where a_i > k? But if a_i > k, even if she tries to water a subsegment of length a_i, it's impossible because the garden is only length k. So those buckets are not usable. But does the condition "it is possible water the garden in integer number of hours using only this bucket" automatically excludes those. So we can just check if a_i <= k and k % a_i == 0. Actually if a_i > k, then k % a_i == k (since k < a_i) which is not 0, so they are excluded anyway by the division condition. So we can just check divisibility.
Thus answer is straightforward.
But the problem statement originally might be from Codeforces 1199A? Actually it's a simple one.
I'll produce a solution: read n, k; read list a; ans = INF; for each a_i: if k % a_i == 0: ans = min(ans, k // a_i); print ans.
That's all. We need to minimize the number of hours required to water the garden of length k by choosing a single bucket that waters a continuous subsegment of exactly a_i length each hour. The garden must be fully covered without overlaps and without watering outside, which is only possible when k is divisible by a_i. Then the required hours are k / a_i. Among all buckets that satisfy k % a_i == 0, we take the smallest k // a_i.
python
import sys
def main():
data = sys.stdin.read().strip().split()
if not data:
return
n, k = map(int, data[:2])
a = list(map(int, data[2:]))
ans = 10**9
for x in a:
if k % x == 0:
ans = min(ans, k // x)
print(ans)
if __name__ == "__main__":
main()