题目描述
Problem Description
Currently, a game called "Foot Game" is popular among the Octopians. The Foot Game is a game where you can clear it by pressing $ N $ buttons at predetermined timings during $ T $ seconds. Button $ i $ must be pressed every $ A_i $ seconds. That is, to clear the Foot Game, you must press button $ i $ at the timings of $ A_i $ seconds after the start, $2 \times A_i$ seconds after the start, $3 \times A_i$ seconds after the start, and so on.
Octopians have the ability to transform and can freely change the number of their legs. To press $ X $ buttons at the same timing, $ X $ legs are needed. How many legs are needed to clear the Foot Game?
Input Format
The input is given from the standard input in the following format:
$ N $ $ T $ $ A_1 $ $ A_2 $ : $ A_N $
- The first line contains an integer $N\ (1 \leq N \leq 1000)$ representing the number of buttons in the Foot Game, and an integer $T\ (1 \leq T \leq 1000)$ representing the play time of the Foot Game, separated by spaces.
- The next $ N $ lines provide information about the timing to press each button. The $ i $-th line contains an integer $A_i\ (1 \leq A_i \leq T)$ representing the interval at which button $ i $ must be pressed.
Output Format
Output a single integer representing the number of legs needed for the Octopians to clear the Foot Game. Also, include a newline at the end of the output.
Sample Input and Output
Sample Input #1
2 6
2
3
Sample Output #1
2
Sample Input #2
2 5
2
3
Sample Output #2
1
Sample Input #3
4 40
7
4
3
14
Sample Output #3
3
Notes/Hints
Sample Explanation 1
In this input example:
- Button $ 1 $ needs to be pressed at the timings of $ 2 $ seconds, $ 4 $ seconds, and $ 6 $ seconds after the start.
- Button $ 2 $ needs to be pressed at the timings of $ 3 $ seconds and $ 6 $ seconds after the start.
At the timing of $ 6 $ seconds after the start, $ 2 $ buttons need to be pressed simultaneously, so $ 2 $ legs are required.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分