0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-28 12:31:59 +00:00

#1061. [SCOI2009]生日快乐

https://sjzezoj.com/submission/39577
This commit is contained in:
Baoshuo Ren 2021-10-17 16:09:36 +08:00 committed by Baoshuo Ren
parent b754cea99f
commit 2ffc5e818c
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

20
S2OJ/1061/1061.cpp Normal file
View 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;
}