1.

/* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem #10007 (Count the Trees)
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=948
*
* @author Dennis Wilfert
* @author Johann Studt
* @version 1.0, 05/29/2009
*
* Status : Accepted
* Runtime: 0.328
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main{

public static void main(String... args) throws NumberFormatException, IOException{

BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

// StringBuilder für die Ausgabe
StringBuilder output = new StringBuilder();
// Eingelesene Zahl
int number;

while(true){
// Zahl lesen
number = Integer.parseInt(reader.readLine());
// Bei 0 beenden
if(number==0)break;
// Anzahl an Ausgabe anhängen
output.append(Trees(number));
output.append("\n");
}
System.out.print(output);
}

/* Anzahl der Binärbäume berechnen
* (2*n)!/(n+1)!
*/
static BigInteger Trees(int n){

// Zähler
BigInteger n1 = BigInteger.ONE;
// Nenner
BigInteger n2 = BigInteger.ONE;

// Fakultät berechnen
for(int i = 1; i <= 2*n; i++){

n1 = n1.multiply(BigInteger.valueOf(i));

if(i==n+1)n2 = n1;

}

return n1.divide(n2);
}

}


2.


/**
* Angewandte Mathematik, SS09, IFB 2C
* ACM Problem: Count the Trees (10007)
* @author Christian Mitterreiter
* @author Rolf Luigs
* @version 1.0, 05/12/2009
* Status : Accepted
* Runtime: 0.412
*/


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


public class Main {

public static BigInteger fak (BigInteger z) { //Fakultät berechnen
BigInteger ret = new BigInteger("1");
BigInteger eins = new BigInteger("1");
BigInteger i = new BigInteger("1");

for(;!i.equals(z);i=i.add(eins)) {
ret=ret.multiply(i);
}
return ret=ret.multiply(i);
}


public static void main(String[] args) {

Scanner sc = new Scanner(System.in);
BigInteger zwei = new BigInteger("2");
BigInteger in = new BigInteger(sc.next());

while(!in.equals(BigInteger.ZERO)) {

BigInteger t1 = fak(zwei.multiply(in));
BigInteger t2 = fak(in.add(BigInteger.ONE));

System.out.println(t1.divide(t2)); // (2n)! / (n+1)!

in = new BigInteger(sc.next());
}
}
}



3.

// 2-te Variante, ohne n2
// (2*n)!/(n+1)! = (n+2)(n+3)*...*(2n)
// Runtime: 0.308

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main{

public static void main(String... args) throws NumberFormatException, IOException{

BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

// StringBuilder für die Ausgabe
StringBuilder output = new StringBuilder();
// Eingelesene Zahl
int number;

while(true){
// Zahl lesen
number = Integer.parseInt(reader.readLine());
// Bei 0 beenden
if(number==0)break;
// Anzahl an Ausgabe anhängen
output.append(Trees(number));
output.append("\n");
}
System.out.print(output);
}

/* Anzahl der Binärbäume berechnen
* (2*n)!/(n+1)!
*/
static BigInteger Trees(int n){

// Zähler
BigInteger n1 = BigInteger.ONE;

// Fakultät berechnen
for(int i = n+2; i <= 2*n; i++){

n1 = n1.multiply(BigInteger.valueOf(i));


}

return n1;
}

}



4.

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

class Main{

public static void main(String... args) throws NumberFormatException, IOException{

BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

// StringBuilder die Ausgabe
StringBuilder output = new StringBuilder();
// Eingelesene Zahl
int n;
BigInteger n1;

while(true){
// Zahl lesen
n = Integer.parseInt(reader.readLine());
// Bei 0 beenden
if(n==0)break;
// Anzahl an Ausgabe anhängen


n1 = BigInteger.ONE;


for(int i = n+2; i <= 2*n; i++){

n1 = n1.multiply(BigInteger.valueOf(i));


}

output.append(n1);
output.append("\n");
}
System.out.print(output);
}



}