/** @file main.cpp @title No.864 四方演算 @url https://yukicoder.me/problems/no/864 **/ #include using namespace std; typedef long long LL; #define ALL(obj) (obj).begin(), (obj).end() #define REP(i, N) for (int i = 0; i < (N); ++i) vector make_divisors(LL n) { vector divisors; for (LL i = 1; i < (LL)sqrt(n) + 1; i++) { if (n % i == 0) { divisors.push_back(i); if (i != (n / i)) { divisors.push_back(n / i); } } } sort(ALL(divisors)); return divisors; } LL seps(LL q, LL N) { if (q < N) { return q - 1; } else { LL ret = 0; for (LL i = 1; i < q; i++) { if (i <= N && q - i <= N) ret++; } return ret; } } template void show(vector& v) { for (uint i = 0; i < v.size(); i++) { cout << v[i] << " "; } cout << "\n"; } int main() { LL N, K; cin >> N >> K; vector divs = make_divisors(K); // show(divs); LL ans = 0; for (auto i : divs) { if (i == 1 || i == K) { continue; } LL j = K / i; ans += seps(i,N) * seps(j,N); } cout << ans << endl; return 0; }