这题n≤10??????!!!!!!
暴搜走起。注意每一块大小都要一样。
#include <cstdio>
#include <algorithm>
using namespace std;
int X, Y, N;
double dfs(double x, double y, int n) {
if(n == 1) return x/y;
//横切
double ans = 11000;
for(int i = 1; i <= n/2; ++i) {
double tx = x * i/n, ty = y * i/n;
ans = min(ans, max(dfs(max(tx, y), min(tx, y), i), dfs(max(x - tx, y), min(x - tx, y), n - i)));
ans = min(ans, max(dfs(max(x, ty), min(x, ty), i), dfs(max(x, y - ty), min(x, y - ty), n - i)));
}
return ans;
}
int main() {
scanf("%d%d%d", &X, &Y, &N);
printf("%.6lf", dfs(max(X, Y), min(X, Y), N));
return 0;
}