#include #include #include using namespace std; int main() { long long n, k; cin >> n >> k; vector> candy; // a + c, b + d for (long long i = 1; i * i <= k; i++) { if (k % i) continue; candy.emplace_back(i, k / i); if (i * i != k) candy.emplace_back(k / i, i); } auto calc = [&](long long x) { if (x <= 1 || x > n * 2) return 0LL; return n - abs(n + 1 - x); }; long long ans = 0; for (auto &p: candy) { ans += calc(p.first) * calc(p.second); } cout << ans << endl; return 0; }