1.

/**
* ACM Training 2009
* ACM Problem #138 Street Numbers
* Link: http://uva.onlinejudge.org/index.php?option=onlinejudge&Itemid=99999999&page=show_problem&category=&problem=74&mosmsg=Submission+received+with+ID+7508657
*
* @author Felix Dietrich
* @version 1.0, 09/21/2009
*
* Methode: Sum formula, quadratic equation
* Status : Accepted
* Runtime: 0.084
*/


public class Main {
public static void main(String... s)
{
long[] solutions = new long[]{
6 , 8,
35 , 49,
204 , 288,
1189 , 1681,
6930 , 9800,
40391 , 57121,
235416 , 332928,
1372105 , 1940449,
7997214 , 11309768,
46611179, 65918161
};
for(int i=0; i<solutions.length-2; i+=2)
{
System.out.println(String.format("%10d%10d", solutions[i], solutions[i+1]));
}
System.out.println(String.format("%10d%10d", solutions[18], solutions[19]));
/*
// VM Arguments: -Xmx1024m
long[] numbers = new long[80000000];
long sum = 0;
long k;
int count = 0;

numbers[0] = 0;
numbers[1] = 0;
numbers[2] = 1;

for (int i = 3; i < numbers.length; i++)
{
sum = numbers[i-1] + i-1;
numbers[i] = sum;
}

for(int i=6; i<numbers.length-1; i++)
{
sum = 0;

//solve: sum(m=1 to n) - Sum(m=1 to i) >= Sum (m=1 to i-1)
// for n and set k to the value of n.
k = (long)(Math.ceil(-1.0 + Math.sqrt(1.0+4.0*(2.0*i*(i-1)+2.0*i)))/2.0);

//the sum is the value at k+1 - the value of the house itself
sum = numbers[(int)k+1] - numbers[i+1];

if(sum == numbers[i])
{
count++;
System.out.println(String.format("%10d%10d", i, k));
}
if(count > 10)
return;
}*/
}
}