Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <cstdio>
  2. #include <iostream>
  3. #include <algorithm>
  4. #include <vector>
  5. #include <cmath>
  6. #include <map>
  7. #define INF 0x3f3f3f3f
  8. #define $ ios::sync_with_stdio(0);
  9. #define S second
  10. #define F first
  11. #define MAXN 112345
  12. using namespace std;
  13.  
  14. int lin(int k)
  15. {
  16.     if(k==0)
  17.         return n;
  18.     return 4*lin(k-1)-pow(2,k-1);
  19. }
  20.  
  21. int main()
  22. {
  23.     int k;
  24.     scanf("%d %d", &n, &k);
  25.     printf("%d\n", 2*lin(k));
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement