Saleh127

codeforces 1204B.cpp

May 26th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define pi acos(-1)
  6. int main()
  7. {
  8. ll a,c=0,d=0,e,f,i,j,k,l,r;
  9. cin>>a>>l>>r;
  10. for(i=0;i<=l-1;i++)
  11. {
  12. c+=pow(2,i);
  13. }
  14. for(i=0;i<a-l;i++)
  15. {
  16. c+=1;
  17. }
  18. for(i=0;i<=r-1;i++)
  19. {
  20. d+=pow(2,i);
  21. }
  22. for(i=0;i<a-r;i++)
  23. {
  24. d+=pow(2,r-1);
  25. }
  26. cout<<c<<" "<<d<<endl;
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment