B. Triangles and a Circle
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

You are given $$$n$$$ distinct points on a circle of length $$$L$$$.

You need to find the number of triangles with vertices in these points that contain the center of the circle inside, or on their border.

Input

The first line of input contains two integers $$$n$$$ and $$$L$$$ ($$$3 \leq n \leq 300\,000$$$, $$$n \leq L \leq 10^9$$$).

Let's choose any point on the circle and call it $$$S$$$. Then any point $$$A$$$ on the circle can be encoded as $$$x$$$, $$$0 \le x \lt L$$$: clockwise distance from $$$S$$$ to $$$A$$$. We will call this number a coordinate of $$$A$$$.

The second line contains $$$n$$$ distinct integers $$$x_1, x_2, \ldots, x_n$$$: coordinates of the given points on the circle ($$$0 \leq x_i \lt L$$$).

Output

Print one integer: the number of triangles with vertices in the given points, that contain the center of the circle inside or on their border.

Examples
Input
3 10
0 1 2
Output
0
Input
10 10
0 1 2 3 4 5 6 7 8 9
Output
60