Points: 5 (partial)
Time limit: 1.0s
Memory limit: 1G
Given a list of integers, compute the number of triples with such that the median of , , and is .
The first line of the input consists of two space-separated integers, and .
The next line contains space-separated integers, the values through representing the numbers of the list in order.
Output, on a single line, the number of valid triples.
4 1 1 1 2 2