#include "cpp_headers/fcpp.hh"

// Berechnet den Binomialkoeffizienten (n ueber k) rekursiv
int binomial(int n, int k) {
    return cond(k > n,
                // Falls k > n: n ueber k = 0
                0,
                cond(k == 0 || n == k,
                     // Falls k = 0 oder n = k: n ueber k = 1
                     1,
                     // sonst rekursiv berechnen
                     binomial(n-1, k-1) + binomial(n-1, k)));
}

int main(int argc, char **argv) {
    return print(binomial(readarg_int(argc, argv, 1),
                          readarg_int(argc, argv, 2)));
}
