Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, b, c, g, i, j;
- cin >> a >> b >> c;
- g = min(a, c);
- if (b % 2){
- i = b / 2 + 1;
- j = i;
- }
- else{
- i = b / 2 + 1;
- j = i - 1;
- }
- if (i <= a && j <= c)
- cout << i + j + b << endl;
- else
- if (g == a)
- cout << 4 * g << endl;
- else
- cout << g * 4 + 2 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement