Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #include <cmath>
- #include <map>
- #define INF 0x3f3f3f3f
- #define $ ios::sync_with_stdio(0);
- #define S second
- #define F first
- #define MAXN 112345
- using namespace std;
- int lin(int k)
- {
- if(k==0)
- return n;
- return 4*lin(k-1)-pow(2,k-1);
- }
- int main()
- {
- int k;
- scanf("%d %d", &n, &k);
- printf("%d\n", 2*lin(k));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement