1 #include <bits/stdc++.h> 2 using namespace std; 3 int main() 4 { 5 int a,b,c; 6 cin>>a>>b>>c; 7 int k; 8 cin>>k; 9 int add=pow(2,k); 10 if(a>=b && a>=c) { 11 //a is the largest 12 cout<<a*add+b+c; 13 } 14 else if(b>=c) 15 { 16 //b is the largest 17 cout<<a+b*add+c; 18 } 19 else { 20 //c is the largest 21 cout<<a+b+c*add; 22 } 23 24 }