1.

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

/**
* Angewandte Mathematik, SS11 Problem: 11525 - Permutations Link:
* http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=27&page=show_problem&problem=2520
*
* @author Benedikt Z¨nnchen
* @author Erik Wenzel
* @version 1.0, 29/04/2011
*
* Method : BigInteger, Combination
* Status : Accepted
* Runtime: 1.132
*
* Erk¦rung: Die Anzahl der B¦ume ist 1/(n+1) * (2n n). Man muss dann noch die Permutationen n! hinzunehmen
* => (2n)!/(n+1)! = (n+2) * (n+3) * ... * (2n)
*/

public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
StringBuilder builder = new StringBuilder();

int number;

while((number=sc.nextInt()) != 0)
{

int start = number+2;
int end = 2*number;

if(start>end)
{
builder.append(number + "\n");
continue;
}
else if(start == end)
{
builder.append(start + "\n");
continue;
}

BigInteger result = new BigInteger(start+"");

while(start < end)
{
start++;
result = result.multiply(new BigInteger(start+""));
}
builder.append(result + "\n");
}
System.out.print(builder);
}

}

2.

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

/**
* Angewandte Mathematik, SS11 Problem: 11525 - Permutations Link:
* http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=27&page=show_problem&problem=2520
*
* @author Benedikt Z¨nnchen
* @author Erik Wenzel
* @version 1.0, 29/04/2011
*
* Method : BigInteger, Combination
* Status : Accepted
* Runtime: 1.132
*
* Erk¦rung: Die Anzahl der B¦ume ist 1/(n+1) * (2n n). Man muss dann noch die Permutationen n! hinzunehmen
* => (2n)!/(n+1)! = (n+2) * (n+3) * ... * (2n)
*/

public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
StringBuilder builder = new StringBuilder();

int number;

while((number=sc.nextInt()) != 0)
{

int start = number+2;
int end = 2*number;

if(start>end)
{
builder.append(number + "\n");
continue;
}
else if(start == end)
{
builder.append(start + "\n");
continue;
}

BigInteger result = new BigInteger(start+"");

while(start < end)
{
start++;
result = result.multiply(new BigInteger(start+""));
}
builder.append(result + "\n");
}
System.out.print(builder);
}

}

3.

/**
* Angewandte Mathematik, SS11
* Problem: 10007 - Count the Trees
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=948
*
* Programm zum Berechnen der Anzahl der möglichen Binärbäume mit n verschiedenen Elementen
*/

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

public class _4_CatalanZahl {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);
int n,numerator,denumerator;
BigInteger result = BigInteger.ONE; //Vorbelegung mit 1, neutrales Element bei Multiplikation
n = input.nextInt();

while(n!=0){
/*
* CatalanZahl * N!
*/
numerator = 2*n;
denumerator = n+2;

for(int c = denumerator; c<=numerator; c++){ // entspricht dem Kürzen des Bruchs
// dadurch wird nurnoch (2*n)*(2*(n-1))*...*(n+2) berechnet
result = result.multiply(BigInteger.valueOf(c));
}
System.out.println(result);
result = BigInteger.ONE; // Zurücksetzten für die nächste Eingabe
n = input.nextInt(); // Einlesen der nächsten Zahl
}
}
}

.----------------------------------------------------------------




1.
package acm_10007_count_the_trees;

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

/**
* FWP, Ausgew¦hlte Probleme aus dem ACM Programming Contest, SS10
* Problem: acm_10007_count_the_trees
* Link:
*
* @author Martin Lambeck
* @version 1.0, 18.08.2010
*
* Method : catalan numbers
* Status : Accepted
* Runtime: 0.620
*/


public class Main
{
static Scanner sc = new Scanner(System.in);

public static void main(String... args)
{
while (testcase())
;
}

public static boolean testcase()
{
int n = sc.nextInt();

if (n == 0)
return false;


System.out.println(trees(n));

return true;
}

static BigInteger trees (int n)
{
int nl = 2*n;
int nf = n+2;

BigInteger bn = BigInteger.ONE;


for (int i = nf; i <= nl; i++)
{
bn = bn.multiply(BigInteger.valueOf(i));
}

return bn;
}

}