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