Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.math.BigInteger;
- import java.util.Scanner;
- public class Main {
- public static int MAX = 41;
- public static long c[][] = new long[MAX][];
- public static void main(String[] args) {
- for (int i = 0; i < MAX; ++i) {
- c[i] = new long[i + 1];
- for (int j = 0; j <= i; ++j) {
- if ((j == 0) || (j == i)) {
- c[i][j] = 1;
- } else {
- c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
- }
- }
- }
- Scanner sc = new Scanner(System.in);
- int n = sc.nextInt();
- int a = sc.nextInt();
- int b = sc.nextInt();
- BigInteger res = BigInteger.valueOf(c[n + a][a]);
- res = res.multiply(BigInteger.valueOf(c[n + b][b]));
- System.out.println(res);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment