#include <iostream>
using namespace std;
double abs(double argument) {
return argument >= 0 ? argument : -argument;
}
int ceil(double argument) {
int result = (int) argument;
if((double) result != argument && argument > 0) {
result++;
} else if((double) result == argument && argument < 0) {
result++;
}
return result;
}
int determineOrderOfPolynomial(double argument, double accuracy) {
int order = 1;
double a = 2 * argument;
while(abs(a) >= accuracy) {
order++;
a *= 2 * argument / (order + 1);
}
return order;
}
double function(double argument, double accuracy) {
int order = determineOrderOfPolynomial(argument, accuracy);
double summand = 2;
double sum = summand;
for(int k = 2; k <= ceil(order / 2.0); k++) {
summand *= -4 * argument * argument / ((2 * k - 2) * (2 * k - 1));
sum += summand;
}
return sum;
}
int main() {
double argument, accuracy;
cin >> argument >> accuracy;
if(argument == 0) {
cout << "empty set";
} else {
cout << function(argument, accuracy);
}
cout << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKZG91YmxlIGFicyhkb3VibGUgYXJndW1lbnQpIHsKCXJldHVybiBhcmd1bWVudCA+PSAwID8gYXJndW1lbnQgOiAtYXJndW1lbnQ7Cn0KCmludCBjZWlsKGRvdWJsZSBhcmd1bWVudCkgewoJaW50IHJlc3VsdCA9IChpbnQpIGFyZ3VtZW50OwoJaWYoKGRvdWJsZSkgcmVzdWx0ICE9IGFyZ3VtZW50ICYmIGFyZ3VtZW50ID4gMCkgewoJCXJlc3VsdCsrOwoJfSBlbHNlIGlmKChkb3VibGUpIHJlc3VsdCA9PSBhcmd1bWVudCAmJiBhcmd1bWVudCA8IDApIHsKCQlyZXN1bHQrKzsKCX0KCXJldHVybiByZXN1bHQ7Cn0KCmludCBkZXRlcm1pbmVPcmRlck9mUG9seW5vbWlhbChkb3VibGUgYXJndW1lbnQsIGRvdWJsZSBhY2N1cmFjeSkgewoJaW50IG9yZGVyID0gMTsKCWRvdWJsZSBhID0gMiAqIGFyZ3VtZW50OwoJd2hpbGUoYWJzKGEpID49IGFjY3VyYWN5KSB7CgkJb3J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