mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 14:56:27 +00:00
parent
b754cea99f
commit
2ffc5e818c
20
S2OJ/1061/1061.cpp
Normal file
20
S2OJ/1061/1061.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int x, y, n;
|
||||
|
||||
double dfs(double x, double y, int k) {
|
||||
if (k == 1) return max(x, y) / min(x, y);
|
||||
double ans = 0x3f3f3f3f;
|
||||
for (int i = 1; i <= k / 2; i++) {
|
||||
ans = min({ans, max(dfs(x / k * i, y, i), dfs(x - x / k * i, y, k - i)), max(dfs(x, y / k * i, i), dfs(x, y - y / k * i, k - i))});
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
|
||||
int main() {
|
||||
cin >> x >> y >> n;
|
||||
cout << fixed << setprecision(6) << dfs(x, y, n) << endl;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user