This page is still under construction.

Parts of this page are still being built. What you see may change.

Beautiful Scoreboard

Time limit2sMemory limit1024 MB

Summary
Given n teams' solved counts and m problems, find the maximum total submissions so the scoreboard stays sorted and every count divides m.
Level

Medium6 of 10

Topics
Greedy, Number theory, Sorting, Math
Solved
No attempts yet

Problem

Oleg is a well-known fan of programming contests. He knows every participant of every contest held over the last ten years, and for any participant he can say how many problems the team that included him solved at any contest. Oleg is also very fond of number theory.

In a programming contest scoreboard, teams are ordered by decreasing number of solved problems. Oleg calls a scoreboard beautiful if for every team the number of problems it solved is zero or a divisor of the number of problems in the contest. When a team submits a problem, the number of problems it has solved increases by one. No team can submit two or more problems at the same time, and two teams cannot submit a problem at the same time either.

Looking at a beautiful scoreboard, Oleg wondered: how many more problems can the teams submit in total so that after each submitted problem the scoreboard stays beautiful? Help him find out.

Input

The first line of the input file contains two integers: nn and mm, the number of teams and the number of problems in the contest, respectively (1≤n≤1001 \le n \le 100, 1≤m≤1091 \le m \le 10^9). The second line contains nn integers in non-increasing order: for each team, the number of problems it solved. It is guaranteed that every nonzero number is a divisor of mm.

Output

Print one number to the output file: the maximum number of problems the teams can submit in total so that after each submitted problem the scoreboard stays beautiful.

Hint

In the example, the teams in 4th and 5th place can submit one problem each, the team in 6th place can submit three, and the team in 7th place can submit four. In total the teams can submit 9 problems this way.

Examples1

  1. Example 1

    Input
    7 12
    12 6 4 3 3 1 0
    
    Expected output
    9