Hide

Problem D
Nafnatalning

Languages en is
/problems/nafnatalning/file/statement/en/img-0001.jpg
The unnamed twins (image from pexels.com)
Sunna and Ari just had twins. They have yet to decide on names for the twins. To be able to distinguish them they don’t want to choose names with the same origin, because as is they can’t tell them apart. They have found $n$ origins that they are interested in and have found $a_i$ names with origin $i$.

The baptism is coming up real soon, only $42$ days! They need to decide what they are going to name the twins before then. Every day they can look at $P$ pairs of names. They have asked you to figure out how many days it will take to look at all pairs of names.

Input

The first line of the input contains two integers $2 \leq n \leq 10^6$ and $1 \leq P \leq 10^9$, in that order. Then there is a single line with $n$ integers, with the $i$-th integer being $0 \leq a_i \leq 1000$.

Output

Print how many days it will take Sunna and Ari to take a look at all the names.

Scoring

Group

Points

Constraints

1

50

$2 \leq n \leq 10^3, 0 \leq a_i \leq 10$

2

50

No further constraints

Sample Input 1 Sample Output 1
2 5
2 3
2
Sample Input 2 Sample Output 2
10 5
1 1 1 1 1 1 1 1 1 1
9