시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB25191878.261%

문제

You are an enthusiastic worker. You want to know how many days you can work during the next specified number of days.

Saturdays and Sundays are non-working days. In addition, a number of national holidays and some company-specific days are non-working days. You cannot work on non-working days. Such non-working days may overlap: The founding anniversary of the company may coincide with a national holiday. Even when such non-working days coincide, there is no system to grant additional non-working days.

Today is Monday. Your task is to count the number of days you can work within a specified period starting from today.

입력

The input consists of at most $100$ test cases. Each test case is given in the following format.

$n$ $m$

$a_1$ $\cdots$ $a_n$

The first line contains the number of additional non-working days $n$, and the number of days of the specified period $m$ ($1 ≤ n ≤ 300$, $1 ≤ m ≤ 10^{18}$). The second line contains $n$ integers, $a_1, \dots , a_n$ ($1 ≤ a_i ≤ 10^{18}$). With today being the first day, the $a_i$-th day for $i = 1, \dots , n$ is a non-working day. The list $a_1, \dots , a_n$ may contain duplicates.

The end of the input is indicated by a line consisting of two zeros.

출력

For each test case, output in a line the number of days you can work during $m$ days starting from today.

예제 입력 1

4 8
1 2 3 4
2 10
15 3
3 14
6 7 13
5 1000000000000000000
8 15 1 8 999999999999999994
2 3
1 4
0 0

예제 출력 1

2
7
10
714285714285714282
2