eolymp
bolt
Try our new interface for solving problems
Problems

Кількість повних квадратів 2

published at 2/15/24, 9:49:51 am

include <bits/stdc++.h>

define ll long long int

define ld long double

using namespace std; int main(){

ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n, m, ans = 0, mn, mx;
cin>>n>>m;
mn = min(m, n);
mx = max(m, n);
for(ll i = sqrt(mn); i<10000000000000000; ++i){
    if(i*i >= mn && i*i <= mx){
        ans++;
    }
    if(i*i > m){
        break;
    }
}
cout<<ans;

} // TECHNOBLADE NEVER DIES