1.
/**
* Angewandte Mathematik, SS11
* Problem: 11448 Who said crisis?
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=2443
* @author Brielbeck, Daniel
* @author Weber, Georg
* @version 1.0, 04/12/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 1.288
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class Main {

public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(
System.in));
String input = reader.readLine();
BigInteger mi = new BigInteger("0");
BigInteger nus = new BigInteger("0");
int k=Integer.parseInt(input);
for (int i=0;i<k;i++) {
input = reader.readLine();
mi = new BigInteger(input.split(" ")[0]);
nus = new BigInteger(input.split(" ")[1]);
System.out.println(mi.subtract(nus));
}
}
}

2.

/**
* Angewandte Mathematik, SS11
* Problem: 11448 Who said crisis?
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=26&problem=2443&mosmsg=Submission+received+with+ID+8738972
*
* @author Unverzart Michael
* @author Wurth Manuel
* @version 1.0, 12/04/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 1.240
*/

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="";

inputLine = reader.readLine();
int cases = new Integer(inputLine);
for(int i = 1 ; i <= cases ; i++)
{
StringTokenizer st = new StringTokenizer(reader.readLine());
BigInteger ergebnis = new BigInteger(st.nextToken()).subtract(new BigInteger(st.nextToken()));
System.out.println(ergebnis);
}
}
}