#include #include using namespace std; const int A = 4; const int B = 6; const int CD = 8; const int E = 6; optional fa(int a) { if (a >= A) { return a/2; } else { return nullopt; } } optional fb(int b) { if (b >= B) { return b/3; } else { return nullopt; } } optional fcd(int c, int d) { if (c*d >= CD) { return c*d/2; } else { return nullopt; } } optional fe(int e) { if (e >= E) { return e; } else { return nullopt; } } int main(int argc, char *argv[]) { int a = atoi(argv[1]); int b = atoi(argv[2]); if (optional tmp, x; (tmp = fa(a)) && (x = fb(b)) && (x = fcd(*tmp, *x)) && (x = fe(*x))) { return *x; } else { return 0; } }