Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- by: senb1
- */
- #include <bits/stdc++.h>
- #define ll long long
- #define all(x) x.begin(), x.end()
- #define fr first
- #define sc second
- #define mk make_pair
- using namespace std;
- const ll mod = 1e9 + 7;
- const ll maxn = 5e8;
- const ll inf = 1e9 + 6;
- void solve() {
- ll k, m;
- cin >> k >> m;
- ll w = k * m * m - 1, ans = 0;
- for (ll x = 0; x <= maxn; x++) {
- ll q = x * (x - m) * (x - 2 * m);
- if (q >= -1 and q <= w)
- ans++;
- }
- cout << ans << endl;
- }
- /*
- */
- int main() {
- ios::sync_with_stdio(0);
- cin.tie(0);
- int t = 1;
- // cin >> t;
- while (t--)
- solve();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement