2018牛客多校第五场G

又是数学题,打完之后我只想说:我不会gcd

#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
int main()
{
    ll c, n;
    cin >> c >> n;
    if(c > n)
        cout << "-1" << endl;
    else if(2 * c > n)
        cout << c * c << endl;
    else
        cout << (n / c) * (n / c - 1) * c * c << endl;
    return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_38759433/article/details/81514472