Skip to content

Commit 12e12e4

Browse files
Create Solution.cpp
1 parent 9a1819a commit 12e12e4

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
int main()
4+
{
5+
long long int i,mini=1,mine=0,maxi=1,maxo=0,n,s,e;
6+
cin>>n>>s>>e;
7+
8+
for(i=1;i<=s-1;i++)
9+
{
10+
mini=2*mini;
11+
mine+=mini;
12+
}
13+
mine+=n-s+1;
14+
15+
for(i=1;i<=e-1;i++)
16+
{
17+
maxi=2*maxi;
18+
maxo+=maxi;
19+
}
20+
maxo+=1;
21+
22+
23+
maxo+=(n-e)*(maxi);
24+
cout<<mine<<" "<<maxo;
25+
return 0;
26+
}

0 commit comments

Comments
 (0)