#d2616. A-B 数对
A-B 数对
A-B Pairs
Problem Description
You are given a sequence of numbers and a number . Count the number of pairs satisfying (two numbers at different positions with the same value are counted as different pairs).
Input Format
Two lines in total.
The first line contains two integers , .
The second line contains integers, the sequence to process.
Output Format
One line containing the number of pairs in the sequence that satisfy .
Sample Input
4 1
1 1 2 3
Sample Output
3
Constraints
, . The input numbers are guaranteed to be below .