//硬币(除法运算用逆元代替)
//2 1 0
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
const int mod = 1e9 + 7;
long long power(int x, int y, const int mod) {
int t = 1;
for (x %= mod; y > 0; x = (long long)x * x % mod, y /= 2) {
if (y % 2 != 0) {
t = (long long)t * x % mod;
}
}
return t;
}
int Cmn(int m, int n, const int mod) {
int t = 1;
for (int i = 0; i < m; ++i) { t = ((t * (n - i) % mod) * power((i + 1), mod - 2, mod)) % mod; }
//t = t * (n - i) / (i + 1);
return t;
}
int main(void) {
int n, p, q;
cin >> n >> p >> q;
//double e = pow(0.5, n);
int u = 0, v = 0;
for (; p + q <= n; ++p) {
u = (u + p * Cmn(p, n, mod) % mod) % mod;
//u += p * Cmn(p, n) * e;
v = (v + Cmn(p, n, mod) % mod) % mod;
//v += Cmn(p, n) * e;
}
cout << (float)u / v << endl;
cout << (u * power(v, mod - 2, mod)) % mod << endl;
getchar();
getchar();
return 0;
}
和楼上的方法一样,用逆元代替除法运算,费马小定理