/* -*- coding: utf-8 -*- * * 864.cc: No.864 四方演算 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ /* typedef */ typedef long long ll; /* global variables */ /* subroutines */ /* main */ /* ab+bc+cd+da=K -> a(b+d)+c(b+d)=(a+c)(b+d)=K */ int main() { ll n, k; scanf("%lld%lld", &n, &k); ll n2 = n * 2; ll sum = 0; for (ll p = 2; p <= n2 && p * p <= k; p++) if (k % p == 0) { ll q = k / p; if (q <= n2) { ll cp = min(p - 1, n) - max(p - n, 1LL) + 1; ll cq = min(q - 1, n) - max(q - n, 1LL) + 1; ll c = cp * cq; sum += c * ((p != q) ? 2 : 1); } } printf("%lld\n", sum); return 0; }