fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, k;
  6. long long brackets [33];
  7. brackets [0] = 1;
  8. for(int i = 1; i <= 32; ++ i){
  9. brackets [i]=0;
  10. for(int j = 0; j < i; ++ j){
  11. brackets [i] += brackets [j] * brackets [i - 1 - j];
  12. }
  13. }
  14. cin >> n;
  15. for (int i = 0; i < n; i ++) {
  16. cin >> k;
  17. cout << (k % 2 == 0 ? brackets [k / 2] : 0) << endl;
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 4528KB
stdin
3
2
3
4
stdout
1
0
2