#include <iostream>
#include <iomanip>
double compute_p(double n, double c) {
double ndc = n - c, p = 1;
for(int i = 0; i < 4 ; ++i, --ndc, --n) { p *= ndc/n; }
return 1 - p;
}
int main() {
std::cout << std::setprecision(3);
constexpr int nmin = 45, nmax = 53;
constexpr int cmin = 15, cmax = 30;
std::cout << "c\\n\t";
for(int n = nmin ; n <= nmax ; ++n)
std::cout << " " << std::setw(4) << n;
std::cout << '\n';
for(int c = cmin ; c <= cmax ; ++c) {
std::cout << c << '\t';
for(int n = nmin; n <= nmax ; ++n) {
std::cout << " " << std::setw(4) << compute_p(n, c)*100 << '%';
}
std::cout << '\n';
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KCmRvdWJsZSBjb21wdXRlX3AoZG91YmxlIG4sIGRvdWJsZSBjKSB7CiAgICBkb3VibGUgbmRjID0gbiAtIGMsIHAgPSAxOwogICAgZm9yKGludCBpID0gMDsgaSA8IDQgOyArK2ksIC0tbmRjLCAtLW4pIHsgcCAqPSBuZGMvbjsgfQogICAgcmV0dXJuIDEgLSBwOwp9CgppbnQgbWFpbigpIHsKICAgIHN0ZDo6Y291dCA8PCBzdGQ6OnNldHByZWNpc2lvbigzKTsKICAgIGNvbnN0ZXhwciBpbnQgbm1pbiA9IDQ1LCBubWF4ID0gNTM7CiAgICBjb25zdGV4cHIgaW50IGNtaW4gPSAxNSwgY21heCA9IDMwOwogICAgc3RkOjpjb3V0IDw8ICJjXFxuXHQiOwogICAgZm9yKGludCBuID0gbm1pbiA7IG4gPD0gbm1heCA7ICsrbikKICAgICAgICBzdGQ6OmNvdXQgPDwgIiAgICIgPDwgc3RkOjpzZXR3KDQpIDw8IG47CiAgICBzdGQ6OmNvdXQgPDwgJ1xuJzsKICAgIGZvcihpbnQgYyA9IGNtaW4gOyBjIDw9IGNtYXggOyArK2MpIHsKICAgICAgICBzdGQ6OmNvdXQgPDwgYyA8PCAnXHQnOwogICAgICAgIGZvcihpbnQgbiA9IG5taW47IG4gPD0gbm1heCA7ICsrbikgewogICAgICAgIAlzdGQ6OmNvdXQgPDwgIiAgIiA8PCBzdGQ6OnNldHcoNCkgPDwgY29tcHV0ZV9wKG4sIGMpKjEwMCA8PCAnJSc7CiAgICAgICAgfQogICAgICAgIHN0ZDo6Y291dCA8PCAnXG4nOwogICAgfQp9