#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include using namespace std; using ld = long double; const vector dx = {0, 0, 1, -1}; const vector dy = {1, -1, 0, 0}; #define vec vector #define int long long #define double long double //cout< #define pq priority_queue signed main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n;cin>>n; int m;cin>>m; vec cnt(m*2+1,0); vec A(n);rep(i,n){cin>>A[i];cnt[A[i]*2]++;} int ans=0; for(int i=1;i<=m/2;i++){ if(i>m/2.0){ int v=2*i; int op=v-m; ans+=cnt[v]*cnt[op]*(n-cnt[v]-cnt[op]); }else{ int v=2*i; int op=v+m; ans+=cnt[v]*cnt[op]*(n-cnt[v]-cnt[op]); } } cout<