/*
 * BinomialCoeff.java
 *
 * Created on July 12, 2009, 1:51 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

/**
 *
 * @author Khalegh
 */
public class BinomialCoeff {
    private static int n = 100;
    private static int [][] bc;
    
    static {
        bc = new int[n + 1][n + 1];
        for (int i = 0; i <= n; i++) {
            bc[i][i] = 1;
            bc[i][0] = 1;
        }
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j < i; j++) {
                bc[i][j] = bc[i-1][j] + bc[i-1][j-1];
            }
        }
    }
    
    public static int biCoeff(int n, int k) {
        return bc[n][k];
    }
}
