Created
July 1, 2017 21:11
-
-
Save MohamedTaha98/601b5d8137a9f2b29e9cfe1ebf7e3fbc to your computer and use it in GitHub Desktop.
Problem Solving
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
int a, b, c, total = 0; | |
cin >> a >> b >> c; | |
while (a != 0) { | |
if (a * 2 <= b && a * 4 <= c) { | |
total = a + 2 * (a + 2 * a); | |
break; | |
} | |
else | |
a--; | |
} | |
cout << total; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment