#include #define int long long using namespace std; signed main(){ int n, x; cin >> n >> x; vector a(n), b(100001); for(int i = 0; i < n; i++) { cin >> a[i]; b[a[i]]++; } int ans = 0; for(int i = 0; i <= 100000; i++){ if(x-i > 100000 || x-i < 0) continue; ans += b[i] * b[x-i]; } cout << ans << endl; }