Advertisement
Guest User

Untitled

a guest
Jan 11th, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main(){
  6.     int t, n;
  7.     scanf("%d",&t);
  8.     for(int a0 = 0; a0 < t; a0++){
  9.         scanf("%d",&n);
  10.         if (n%2==0)
  11.             printf("%d\n", (int) pow(2, ((n/2)+1)) - 1);
  12.         else
  13.             printf("%d\n", (int) (pow(2, ((n-1)/2)+1)-1) * 2);
  14.     }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement