14049 - Domo's Treasure   

Description

Domo is a brilliant dog. During Domo's exploration on the waterway, he discovered a treasure. Unfortunately, he doesn't know the password for the treasure chest yet. Please help him find the password so he can claim the treasure.

 

On the treasure chest, there is a sequence of numbers, and the password for the treasure chest is the count of subsequences that follow the rules below:

 

1. The length of the subsequence is 4.

2. The sum of the subsequence is S.

3. The subsequnce [Ai​, Aj​, Ak​, Al​] should satisfies that Ai​ ≤ Aj​ ≤ Ak​ ≤ Al

 

For example, if the sequence is [1, 1, 1, 3, 3, 5, 1], and S is 8

 

Then, the following four subsequences satisfy the rules above.

1. [1, 1, 1, 5], where the index is 0, 1, 2, 5

2. [1, 1, 3, 3], where the index is 0, 1, 3, 4

3. [1, 1, 3, 3], where the index is 0, 2, 3, 4

4. [1, 1, 3, 3], where the index is 1, 2, 3, 4

 

Hence, the password would be 4.

 

Input

The first line consists of two integers N (1 ≤ N ≤ 50) and S (1 ≤ S ≤ 100), describing the length of the sequence and S.

 

The next line consists of N integers, describing the given sequence. (0 ≤ Ai ≤ 50)

 

Output

Output the password of the chest. Remember to print a newline character at the end of the line.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss