Card Game
문제
Vilius and Adomas play a simple card game. They have a deck of cards. Every card contains a number. Each player draws two random cards from the deck, adds the two numbers on the cards, and the player with the larger sum wins.
Vilius chose a number and wants to win by exactly points. In other words, he wants the sum of his cards minus the sum of Adomas's cards to be exactly . How many ways there are for Vilius and Adomas to draw their cards so that Vilius wins by exactly points?
The same number can be written on multiple cards. Then the case when a player draws one or another of them are considered distinct. The order of the two cards in a player's hand, however, does not matter. For example, if two cards contain the number and three cards contain the number , there would be six ways for Adomas to draw cards with numbers and .
입력
The first line contains two integers and (, ), the number of cards in the deck and the desired score difference, respectively. The second line contains integers (), the numbers on the cards.
출력
Output a single integer: the number of ways the players can draw cards so that Vilius wins by exactly points.
예제
예제 1
5 3 1 3 4 5 6
2
예제 2
5 0 2 2 2 2 2
30