fork download
  1. import java.util.Scanner;
  2.  
  3. class Main{
  4. public static void main (String[] args) throws java.lang.Exception{
  5. Scanner in = new Scanner(System.in);
  6. int n, k;
  7. long[] brackets = new long[33];
  8. brackets[0] = 1;
  9. for(int i = 1; i <= 32; ++ i){
  10. brackets[i] = 0;
  11. for(int j = 0; j < i; ++ j){
  12. brackets[i] += brackets[j] * brackets[i - 1 - j];
  13. }
  14. }
  15. n = in.nextInt();
  16. for (int i = 0; i < n; i ++) {
  17. k = in.nextInt();
  18. System.out.println(k % 2 == 0 ? brackets[k / 2] : 0);
  19. }
  20. }
  21. }
Success #stdin #stdout 0.11s 35268KB
stdin
6
2
28
42
14
64
0
stdout
1
2674440
24466267020
429
55534064877048198
1