1.

/**
* Angewandte Mathematik, SS11
* Problem: 10790 - How Many Points of Intersection?
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1731
*
* @author Markus Schöllner
* @author Andreas Maier
* @version 1.0, 07/03/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.440
*/

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


public class Main {


public static void main(String[] args) {
Scanner input = new Scanner(System.in);

int a,b;
BigInteger result,tmp1,tmp2;
a = input.nextInt();
b = input.nextInt();
int c = 1;
while((a!=0)&&(b!=0)){
tmp1 = BigInteger.valueOf(a*b);
tmp2 = BigInteger.valueOf((a-1)*(b-1));
result = tmp1.multiply(tmp2);
result = result.divide(BigInteger.valueOf(4));
a = input.nextInt();
b = input.nextInt();
System.out.println("Case "+c+": "+result);
c++;
}


}

}


------------------------------------------------------------------------

1.
/**
> * Angewandte Mathematik, SS11
> * Problem: 10790 - How Many Points of Intersection?
> * Link:
> http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1731
> * @author Brielbeck, Daniel
> * @author Weber, Georg
> * @version 1.0, 05/31/2011
> * Method : Ad-Hoc
> * Status : Accepted
> * Runtime: 0.308
> */
> import java.io.BufferedReader;
> import java.io.InputStreamReader;
>
> public class Main {
>
> public static void main(String[] args) throws Exception {
> BufferedReader reader = new BufferedReader(new
> InputStreamReader(System.in));
> String input;
> long a,b,i=1;
> while ((input = reader.readLine()) != null)
> {
> String[] temp = input.split(" ");
> a=Integer.valueOf(temp[0]);
> b=Integer.valueOf(temp[1]);
> if (a==0&&b==0) break;
> //ergibt sich aus (a über 2) mal (b über 2)
> System.out.println("Case "+(i++)+": "+((a*b*(a-1)*(b-1))/4));
> }
> }
> }


2.
/**
* Angewandte Mathematik, SS11
* Problem: 10790 - How Many Points of Intersection?
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1731
*
* @author Unverzart Michael
* @author Wurth Manuel
* @version 1.0, 31/5/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.316
*/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main {

public static void main(String[] args) throws Exception{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String inputLine;
int z = 0;
while((inputLine = reader.readLine()) != null){
StringTokenizer st = new StringTokenizer(inputLine);
int a = new Integer(st.nextToken());
int b = new Integer(st.nextToken());
if(a==0 && b==0) break;
z++;
BigInteger erg = (BigInteger.valueOf(a).multiply(BigInteger.valueOf(b)).multiply(BigInteger.valueOf(a-1)).multiply(BigInteger.valueOf(b-1))).divide(BigInteger.valueOf(4));
System.out.println("Case "+z+": "+erg);
}
}
}