Skip to content

Instantly share code, notes, and snippets.

@MohamedTaha98
Created July 1, 2017 21:11
Show Gist options
  • Save MohamedTaha98/601b5d8137a9f2b29e9cfe1ebf7e3fbc to your computer and use it in GitHub Desktop.
Save MohamedTaha98/601b5d8137a9f2b29e9cfe1ebf7e3fbc to your computer and use it in GitHub Desktop.
Problem Solving
#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