#include #define rep(i, p, n) for (ll i = p; i < (ll)(n); i++) #define rep2(i, p, n) for (ll i = p; i >= (ll)(n); i--) using namespace std; using ll = long long; using ld = long double; const double pi = 3.141592653589793; const long long inf = 2 * 1e9; const long long linf = 4 * 1e18; const ll mod1 = 1000000007; const ll mod2 = 998244353; template inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } // atcoder #include using namespace atcoder; using mint1 = modint1000000007; using mint2 = modint998244353; vector> base = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}}; template struct FormalPowerSeries : vector { using vector::vector; FormalPowerSeries &operator+=(const FormalPowerSeries &r) { if (r.size() > this->size()) this->resize(r.size()); for (size_t i = 0; i < r.size(); i++) (*this)[i] += r[i]; return *this; } FormalPowerSeries operator*(const FormalPowerSeries &r) const { FormalPowerSeries res(this->size() + r.size() - 1); for (size_t i = 0; i < this->size(); i++) for (size_t j = 0; j < r.size(); j++) res[i + j] += (*this)[i] * r[j]; return res; } }; // 定数 const int MAX_A = 100000; int main() { ////////////////// ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); ////////////////// ll N; ll X; cin >> N >> X; vector a(N); for (int i = 0; i < N; ++i) cin >> a[i]; vector freq(MAX_A + 1, 0); for (int num : a) freq[num] += 1; auto C = convolution_ll(freq, freq); ll result = 0; if (X <= 2 * MAX_A) result = C[X]; cout << result << '\n'; return 0; }