mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 18:56:28 +00:00
P4160 [SCOI2009]生日快乐
R60087012
This commit is contained in:
parent
248b1ac56b
commit
b754cea99f
20
Luogu/problem/P4160/P4160.cpp
Normal file
20
Luogu/problem/P4160/P4160.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