#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; //#define int long long typedef long long ll; typedef unsigned long long ul; typedef unsigned int ui; const ll mod = 1000000007; const ll INF = mod * mod; typedef pair P; #define stop char nyaa;cin>>nyaa; #define rep(i,n) for(int i=0;i=0;i--) #define Rep(i,sta,n) for(int i=sta;i=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) typedef pair LP; typedef vector vec; typedef vector svec; typedef long double ld; typedef pair LDP; const ld eps = 1e-8; void solve() { ll n, k; cin >> n >> k; vector d; for (ll i = 1; i <= 1000000; i++) { if (k%i == 0) { d.push_back(i); d.push_back(k / i); } } sort(d.begin(), d.end()); d.erase(unique(d.begin(), d.end()), d.end()); ll ans = 0; rep(i, d.size()) { ll l = d[i]; ll r = k / d[i]; l--; r--; if (l > n) { l = 2 * n - l; if (l < 0)l = 0; } if (r > n) { r = 2 * n - r; if (r < 0)r = 0; } ans += l*r; } cout << ans << endl; } signed main() { ios::sync_with_stdio(false); cin.tie(0); //cout << fixed << setprecision(10); //init(); solve(); //cout << "finish" << endl; //stop return 0; }