思想:期望,概率
#include <bits/stdc++.h>
using namespace std;
double P[1010][1010];
const double eps = 1E-9;
double quick_power(double a, int b)
{
if (b == 0)
return 1;
double ans = quick_power(a, b >> 1);
ans = ans * ans;
if (b & 1)
ans = ans * a;
return ans;
}
int main()
{
// cout << quick_power(0.5, 4) << endl;
int w, h, k;
cin >> k >> w >> h;
for (int i = 1; i <= w; i ++)
for (int j = 1; j <= h; j ++)
{
double p = (2. * i * (w - i + 1) - 1) * (2. * j * (h - j + 1) - 1) / (1. * w * h * w * h);
// cout << p << endl;
P[i][j] = 1 - quick_power(1 - p, k);
}
double ans = 0;
for (int i = 1; i <= w; i ++)
for (int j = 1; j <= h; j ++)
ans += P[i][j];
long long dd = round(ans);
cout << dd << endl;
// cout << ans << endl;
return 0;
}