1.

/**Angewandte Mathematik, SS11
* Problem: 10079 - Pizza Cutting
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=1020
*
* @author Ritter Marius
* @author Wende Tom
* @author Zehentbauer Stefan
* @version 1.0, 04/20/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.136
*/
import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
long n = scan.nextLong();
long t=0;
while(scan.hasNext() && n>=0)
{
t=(n*(n+1))/2+1;
System.out.println(t);
n = scan.nextLong();
}
}
}

2.

/**
* Angewandte Mathematik, SS11
* Problem: 10079 - Pizza Cutting
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=1020
*
* @author Markus Schöllner
* @author Andreas Maier
* @version 1.0, 04/20/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.104
*/

import java.io.*;
import java.math.*;

public class Main {

public static void main(String[] args) throws IOException {

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

String a = input.readLine();
BigInteger number = new BigInteger(a);
int compare = number.signum();

while(compare >=0){

number = number.multiply((number.add(BigInteger.ONE)));
number = number.divide((BigInteger.ONE.add(BigInteger.ONE)));
number = number.add(BigInteger.ONE);
System.out.println(number);

a = input.readLine();
number = new BigInteger(a);
compare = number.signum();
}
}
}

3.

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
* Angewandte Mathematik, SS11
* Problem: 10079 - Pizza Cutting
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=1020
*
* @author Unverzart Michael
* @author Wurth Manuel
* @version 1.0, 11/4/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.100
*/

public class Main {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String inputLine;
while((inputLine = reader.readLine())!=null)
{
long n = new Long(inputLine);
if(n>=0){
System.out.println(1 + (n * (1 + n))/2);
}
}
}
}


4.

/**
* Angewandte Mathematik, SS11
* Problem: 10079 Pizza Cutting
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=1020
*
* @author Georg Weber, Daniel Brielbeck
* @version 1.0, 03/05/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.112
*/
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;
while ((input = reader.readLine()) != null)
{
long n=Long.valueOf(input);
if(n<0) System.exit(0);
System.out.println(1 + (n*(n+1))/2);
}

}

}


----------------------------------------------------
1.

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, WS10/11
* Problem: 10079 - Pizza Cutting
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=12&problem=1020&mosmsg=Submission+received+with+ID+8351644
*
* @author Manuel Hager
* @version 1.0, 10/26/2010
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.004
*/

#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
long number;
cin >> number;

while(number >= 0) {
if((number & 1)) //odd
cout << (((number + 1)/2) * number) + 1<< endl;
else //even
cout << ((number/2) * (number + 1)) + 1<< endl;

cin >> number;
}

return 0;
}


2.


/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
* Problem: 10079 Pizza Cutting
*
* @author Robert Reichart
*
* Status : Accepted
* Runtime: 0.096
*/

import java.io.*;

class Main{
public static void main(String... args)throws Exception{
BufferedReader is= new BufferedReader(new InputStreamReader(System.in));
long wert = 0;
wert=Integer.parseInt(is.readLine());
while (wert>=0){
System.out.println((wert*(wert+1))/2+1);
wert=Integer.parseInt(is.readLine());
}
}
}