#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // #include // #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector vl; typedef vector ml; typedef vector> mati; typedef vector> matl; // typedef pair P; // typedef pair PP; #define rep(i, n) for(int i = 0; i < (n); i++) #define revrep(i, n) for(int i = (n)-1; i >= 0; i--) #define itrrep(itr, s) for(auto itr=s.begin(); itr!=s.end(); itr++) #define pb push_back #define f first #define s second #define chmin(x, y) x = min(x, y); #define chmax(x, y) x = max(x, y); #define len(x) ((ll)(x).size()) #define all(x) (x).begin(), (x).end() #define srt(x) sort(all(x)) #define rvs(x) reverse(all(x)) #define lb(x, v) lower_bound(all(x), v) const ll INFL = 1LL<<60; const ll INF = 1LL<<30; // const ll MOD = 1000000007; const ll MOD = 998244353; double EPS = 1e-10; const double PI=3.1415926535897932384626433832795028841971; vectordy={0,1,0,-1,1,1,-1,-1,0}; vectordx={1,0,-1,0,1,-1,1,-1,0}; // for debug template void put(__T__ x){cout< void put(pair<__T__ , __U__> x){put("{");put(x.f);put(", ");put(x.s);put("}");} template void put(vector<__T__> x){put("[");rep(i,len(x)){put(x[i]);if(i!=len(x)-1)put(", ");}put("]");} template void put(set<__T__> x){put("{");auto itr=x.begin();while(itr!=x.end()){put(*itr);itr++;if(itr!=x.end()){put(", ");}}put("}");} template void put(map<__T__, __U__> x){put("{");auto itr=x.begin();while(itr!=x.end()){put(itr->f);put("->");put(itr->s);itr++;if(itr!=x.end()){put(", ");}}put("}");} void print(){cout< void print(Head&& head){put(head);cout< void print(Head&& head, Tail&&... tail){put(head);put(" ");print(std::forward(tail)...);} #define debug(x) cout<<#x<<": ";print(x); // io util template void vecin(vector<__T__>& x){rep(i, len(x)){cin>>x[i];}} template void matin(vector>& x){rep(i,len(x))rep(j,len(x[i])){cin>>x[i][j];}} template void vecout(vector<__T__> x){rep(i,len(x)){cout< void matout(vector> x){rep(i,len(x)){vecout(x[i]);}} template void output(__T__ x){cout << x << endl;} void input(){} template void input(Head&& head, Tail&&... tail){cin>>head;input(forward(tail)...);} // util template vector<__T__> to_unique(vector<__T__> x){sort(all(x));x.erase(unique(all(x)), x.end());return x;} void pres(double A){cout<>(y-1-i)&1);cout<0){if(k%2)res*=x;x*=x;k/=2;}return res;} ll pow_mod(ll x,ll k,ll _mod=MOD){ll res=1;while(k>0){if(k%2){res*=x;res%=_mod;}x*=x;x%=_mod;k/=2;}res%=_mod;return res;} ll inverse(ll x,ll _mod=MOD){return pow_mod(x,MOD-2,_mod);}; ll gcd(ll a,ll b){if(b==0){return a;}return gcd(b,a%b);} ll lcm(ll x,ll y){return x/gcd(x,y)*y;}; ll digit(ll A,ll d=10){ll res=0;while(A){res++;A/=d;}return res;} ll str2ll(string s){ll res=0;rep(i,len(s)){res=res*10+s[i]-'0';}return res;} ll str2llmod(string s,ll mod=MOD){ll res=0;rep(i,len(s)){res=(res*10+s[i]-'0')%mod;}return res;} string ll2str(ll x){if(x==0)return "0";string res;ll d=digit(x);rep(i,digit(x)){res+='0'+x/pow_long(10,d-1-i)%10;}return res;} // c++ -std=gnu++14 a.cpp // g++ a.cpp -Wno-unqualified-std-cast-call -std=c++14 -I . // #include void solve(){ ll N, X; cin >> N >> X; vector A(100001, 0); rep(i, N){ ll a; cin >> a; A[a]++; } vector B = atcoder::convolution_ll(A, A); if(X > 200000) cout << 0 << endl; else cout << B[X] << endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); solve(); }