package com.njupt.acm;

import java.math.BigInteger;
import java.util.Scanner;



public class POJ_2084 {
	
	public static void main(String[] args) {
		BigInteger catalan[] = new BigInteger[102];
		catalan[1] = new BigInteger("1");
		
		BigInteger one = new BigInteger("1");
		BigInteger two = new BigInteger("2");
		BigInteger four = new BigInteger("4");
		
		int i;
		for(i = 1 ; i <= 100 ; ++i){
			
			catalan[i+1] = catalan[i].multiply(four.multiply(new BigInteger(i + "")).subtract(two)).divide(new BigInteger(i + "" ).add(one));
			
		}
		
		Scanner scanner = new Scanner(System.in);
		int n ;
		
		while(true){
			n = scanner.nextInt();
			if(n < 0){
				break;
			}
			
			System.out.println(catalan[n + 1]);
		}
		
	}
}


相关文章:

  • 2021-07-20
  • 2022-12-23
  • 2022-12-23
  • 2021-05-03
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-27
  • 2022-12-23
  • 2022-01-10
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
相关资源
相似解决方案