#include #include #include #include #define rep(i,n) for (int i = 0; i < (int)(n); i++) using namespace std; using ll = long long; template inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); } template ostream& operator<<(ostream& os, const vector& vec) { os << vec[0]; for (int i = 1; i < (int)vec.size(); i++) os << " " << vec[i]; return os; } template istream& operator>>(istream& is, vector& vec) { for (T& x : vec) is >> x; return is; } vector getDivisions(ll N) { vector ans; ll i = 1; for (i = 1; i * i < N; i++) { if (N % i == 0) { ans.push_back(i); ans.push_back(N / i); } } if (i * i == N) ans.push_back(i); return ans; } // (a + c) * (b + d) = K int main() { ll N, K; cin >> N >> K; vector divisions = getDivisions(K); ll ans = 0; for (auto div : divisions) { int cnt1 = 0; for (int a = 1; a <= div; a++) { if (a <= N && div - a <= N && div - a >= 1) cnt1++; } int cnt2 = 0; for (int c = 1; c <= K / div; c++) { if (c <= N && K / div - c <= N && K / div - c >= 1) cnt2++; } ans += (ll)cnt1 * cnt2; } cout << ans << endl; return 0; }