Problem D
Nafnatalning
Languages
en
is
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 |