#include <iostream>
#include <functional>
using namespace std; // consider removing this line in serious projects
class T {
public:
double execute(function<double()> expression) {
return expression();
}
};
int main() {
T t;
int a = 0, b = 1;
function<double()> func = [&]() -> double {return 3 * a + 5 * b;};
double result = t.execute([&]() -> double {return 3 * a + 5 * b;});
cout << result << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsgLy8gY29uc2lkZXIgcmVtb3ZpbmcgdGhpcyBsaW5lIGluIHNlcmlvdXMgcHJvamVjdHMKCmNsYXNzIFQgewpwdWJsaWM6CiAgICBkb3VibGUgZXhlY3V0ZShmdW5jdGlvbjxkb3VibGUoKT4gZXhwcmVzc2lvbikgewogICAgICAgIHJldHVybiBleHByZXNzaW9uKCk7CiAgICB9Cn07CgppbnQgbWFpbigpIHsKCVQgdDsKICAgIGludCBhID0gMCwgYiA9IDE7CiAgICBmdW5jdGlvbjxkb3VibGUoKT4gZnVuYyA9IFsmXSgpIC0+IGRvdWJsZSB7cmV0dXJuIDMgKiBhICsgNSAqIGI7fTsKCWRvdWJsZSByZXN1bHQgPSB0LmV4ZWN1dGUoWyZdKCkgLT4gZG91YmxlIHtyZXR1cm4gMyAqIGEgKyA1ICogYjt9KTsKCWNvdXQgPDwgcmVzdWx0IDw8IGVuZGw7CgoJcmV0dXJuIDA7Cn0=