#P8834. [传智杯 #3 决赛] 序列
[传智杯 #3 决赛] 序列
Background
disangan333 likes disangan233, so he also wants you to help him count.
Problem Description
ChuanZhi Academy has students, and each student has a number . There is also a constant .
If there are two students, the -th student and the -th student, satisfying and , then these two students are called a "harmonious pair". How many "harmonious pairs" are there among these students?
For all testdata, , , .
Input Format
The input has lines.
The first line contains two positive integers .
The second line contains positive integers .
Output Format
Output line with integer, which is the answer.
5 5
1 2 3 4 5
4
Hint
Sample Explanation
In the sample, the pairs , , , are all "harmonious pairs".
Translated by ChatGPT 5