fork download
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. int main(void) {
  5.  
  6. int i,n,a,c,b,m,mx,j;
  7. cin>>a>>b>>c;
  8. i=min(a,b);
  9.  
  10. j=(i!=a)?a:b;
  11.  
  12. m=2*(i+j);
  13. mx=i+j+c;
  14. cout<<max(m,mx);
  15.  
  16.  
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
1417954237