A-B数对

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

出题是一件痛苦的事情!

相同的题目看多了也会有审美疲劳,于是我舍弃了大家所熟悉的 A+B Problem,改用 A-B 了哈哈!

好吧,题目是这样的:给出一串数以及一个数字 C,要求计算出所有 AB=CA - B = C 的数对的个数(不同位置的数字一样的数对算不同的数对)。

Input

输入共两行。

第一行,两个整数 N, C。

第二行,N 个整数,作为要求处理的那串数。

Output

一行,表示该串数中包含的满足 AB=CA - B = C 的数对的个数。

Samples

4 1
1 1 2 3
3

Limitation

1s, 1024KiB for each test case.

第七届SWPU-ACM老生预选赛

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
187
Start at
2022-9-19 14:00
End at
2022-10-28 14:00
Duration
936 hour(s)
Host
Partic.
45