Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <unordered_map>
- #include <algorithm>
- #include <set>
- #include <iomanip>
- #include <string>
- using namespace std;
- double n, m, k;
- bool canUse(double val) {
- return (k <= (long long)(n / val) * (long long)(m/val));
- }
- int main()
- {
- cin.tie(NULL);
- cout.tie(NULL);
- ios_base::sync_with_stdio(false);
- cout << fixed << setprecision(10);
- cin >> n >> m >> k;
- //NADO K SHTUK!
- double l = 0.000001, r = 1001, prev = 99999999999;
- while (abs(((l + r) / 2.0) - prev) > 0.000001) {
- double m = (l + r) / 2.0;
- if (canUse(m))
- l = m;
- else
- r = m;
- prev = m;
- }
- cout << (l + r) / 2.0;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement