Advertisement
Dennnhhhickk

Untitled

Dec 19th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a, b, c, g, i, j;
  8. cin >> a >> b >> c;
  9. g = min(a, c);
  10. if (b % 2){
  11. i = b / 2 + 1;
  12. j = i;
  13. }
  14. else{
  15. i = b / 2 + 1;
  16. j = i - 1;
  17. }
  18. if (i <= a && j <= c)
  19. cout << i + j + b << endl;
  20. else
  21. if (g == a)
  22. cout << 4 * g << endl;
  23. else
  24. cout << g * 4 + 2 << endl;
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement