1.

/**
* Angewandte Mathematik, SS11
* Problem: 10213 - How Many Pieces of Land ?
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=14&page=show_problem&problem=1154
*
* @author Markus Schöllner
* @author Andreas Maier
* @version 1.0, 05/22/2011
*
* Method : Ad-Hoc
* Status : In judge queue
* Runtime:
*/

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


public class Main {

public static void main(String[] args) {

Scanner input = new Scanner(System.in);

int s;
int n;
s = input.nextInt();
int fact4 = 24;
int fact2 = 2;
BigInteger numerator = BigInteger.ONE;
BigInteger result;

for(int c=0; c<s;c++){
result = BigInteger.ZERO;
numerator = BigInteger.ONE;

n = input.nextInt();

if(n!=1 && n!=2 && n !=3 && n!=4){
int nMinus4 = n-4;
for(int i=n; i > nMinus4;i--){
numerator = numerator.multiply(BigInteger.valueOf(i));
}

result = numerator.divide(BigInteger.valueOf(fact4));

numerator = BigInteger.ONE;
for(int i=n; i>(n-2);i--){
numerator = numerator.multiply(BigInteger.valueOf(i));
}
result = result.add(numerator.divide(BigInteger.valueOf(fact2)));
result = result.add(BigInteger.ONE);
System.out.println(result);
}
else{
switch(n){
case 1:
System.out.println("1");
break;
case 2:
System.out.println("2");
break;
case 3:
System.out.println("4");
break;
case 4:
System.out.println("8");
break;
}
}
}

}

}