public class Exam9095_Recursive { public static int go(int count, int sum, int goal) { if(count>10) { return 0; } if(sum == goal) { return 1; } int now = 0; for(int i=1;i<=3;i++) { now = now + go(count+1, sum+i,goal); } return now; }
public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); int test_case = Integer.parseInt(bf.readLine()); while(test_case-- >0) { int number = Integer.parseInt(bf.readLine()); System.out.println(go(0,0,number)); } }