1.


/**
 * FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
 * Problem: 10783 Odd Sum
 * Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1724
 *
 * @author Anton Pavlushko, IBB7B, 
 * @version 1.0, 02/11/2010
 *
 * Status : Accepted
 * Runtime: 0.100
 */

import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String current_line;
        int count, i, a, b, summa, m , n;
        StringTokenizer input_string;
        boolean status, at_least_one;
       
         try {
             current_line=in.readLine();
             count=Integer.parseInt(current_line);
             for(i=1;i<=count;i++) {
                 a=Integer.parseInt(in.readLine());
                 b=Integer.parseInt(in.readLine());
                 
                 m=(a)*(a-1)/2 - ((a-1)/2+1)*((a-1)/2);
                 n=(b+1)*b/2 - (b/2+1)*(b/2);
//                 System.out.println((a+1)*a/2+" "+(b+1)*b/2);
//                 System.out.println((a/2+1)*(a/2)+" "+(b/2+1)*(b/2));
                 summa = n-m;
                 if (a==b) summa=0;
                 
                 System.out.println("Case "+i+": "+summa);
                 
             }
             
             
           } // end try
           catch (IOException ee) {
             System.err.println("Error: " + ee);
           }
    }
}


2.

/**


* FWP, Ausgewählte Probleme aus dem
ACM Programming Contest, SS10


* Problem: 10783 Odd Sum


*
Link:
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=19&problem=1724&mosmsg=Submission+received+with+ID+7916994


* @author Viktoriya Ryabova


* @version 1.0, 04/22/2010


*


* Method : Ad-Hoc


* Status : accepted


* Runtime: 0.128


*/



 

import
java.util.Scanner;


public class Main {



/**


* @param args


*/


public static
void main(String[] args) {


//
TODO Auto-generated method stub


Scanner sc = new
Scanner(System.
in);


//wie viele fälle


int
count=Integer.parseInt(sc.nextLine());


//nummer des falles


int i=1;


while(count>0){


//zahlen einlesen


int a =
Integer.parseInt(sc.nextLine());


int b
=Integer.parseInt(sc.nextLine());


if(a<=b &&
(a>=0&&b<=100)){


System.out.println("Case "+i+":
"
+oddSum(a,b));


}


count--;


i++;


}



}


public static
int oddSum (int a,
int b){


int sum=0;


//Summe von ungeraden zahlen
berechnen


for(int i=a;
i<=b; i++ ){


if(i%2!=0)sum+=i;


}


//System.out.println(sum);


return sum;


}



}