1. Java, Till Fischer

/*

 ============================================================================

 Name            : Main.java

 Author            : Till Fischer

 Description    : 10007 - Count the Trees

 Accepted        : Accepted

 Time            : 0.460

 ============================================================================

 */

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) {

            line = reader.readLine();

            if(line.equals("0"))

                break;

            System.out.println(faculty(Integer.parseInt(line)).multiply(catalan(Integer.parseInt(line))));

        }

        reader.close();

        writer.flush();

        writer.close();

    }

    
    private static BigInteger faculty(int n) {

        BigInteger r = BigInteger.ONE;

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

            r = r.multiply(new BigInteger(new Integer(i).toString()));

//        System.out.println("faculty of " + n + " = " + r);

        return r;

    }

   
    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()));

       

//        System.out.println("catalan of " + n + " = " + r);

        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()));

        }

//        System.out.println("binomial of " + n + " = " + result);

        return result;

    }



}

2. Java, Evgeni Pavlidis

/**
* ACM programming Contest WS 08/09
* UVa Status: accepted
* Run Time: 0.440
* Category: math
* @author Evgeni Pavlidis evgenipavlidis@yahoo.de
*/
import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class Main {


public static BigInteger getBinomial(int n, int k)
{
if(k > n/2)
k = n-k;

BigInteger r = BigInteger.ONE;

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

public static void main(String... args) throws Exception
{
int n;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

n = Integer.parseInt(reader.readLine());

while(n != 0)
{
BigInteger l = getBinomial(2*n,n).divide(new BigInteger(new Integer(n+1).toString()));
System.out.println( factorial(n).multiply(l) );
n = Integer.parseInt(reader.readLine());
}
}

private static BigInteger factorial(int n)
{
BigInteger b = BigInteger.ONE;
for(int i = 2; i <= n; i++)
b = b.multiply(new BigInteger(new Integer(i).toString()));

return b;
}

}