1. JAVA, Till Fischer

/*
============================================================================
Name : Main.java
Author : Till Fischer
Description : 10303 - How many Trees
Accepted : Accepted
Time : 0.320
============================================================================
*/
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.math.BigInteger;


public class Main {

public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new
InputStreamReader(System.in));
BufferedWriter writer = new BufferedWriter(new
OutputStreamWriter(System.out));
String line;
while(true) {
try {
line = reader.readLine();
System.out.println(catalan(Integer.parseInt(line)));
} catch (Exception e) {
break;
}
}
reader.close();
writer.flush();
writer.close();
}

private static BigInteger catalan(int n) {
if(n == 0)
return BigInteger.ONE;
BigInteger r;
r = binomial(2*n, n);
r = r.divide(new BigInteger(new Integer(n+1).toString()));

return r;

}

private static BigInteger binomial(int n, int k) {
BigInteger result = BigInteger.ONE;

if( k > n/2) {
k = n - k;
}

for(int i = 0; i < k; i++) {
result = result.multiply(new BigInteger(new Integer(n-i).toString()));
result = result.divide(new BigInteger(new Integer(i + 1).toString()));
}
return result;
}

}