Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- #define long long long
- #define nln '\n'
- using namespace std;
- int main()
- {
- long are;
- cin >> are;
- long miv = LLONG_MAX;
- for (long i = round(sqrt(are)); i >= 1; --i)
- if (are % i == 0 && 2*(i + are/i) < miv)
- miv = 2*(i + are/i);
- cout << miv << nln;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment