#include <iostream>
using namespace std;
long double f(long double s) //модуль числа
{
if (s<0) s=-s;
return s;
}
long double cotan (long double x, long double e)
{
long double sin=x, cos=1, cotan=0, a=1;
int n=2;
while (f(cos/sin-cotan)>e)
{
cotan = cos/sin;
a*=-x*x/((n-1)*n);
cos+= a;
sin+= a*x/(n+1);
n+=2;
}
cotan = cos/sin;
return cotan;
}
int main()
{
long double x,e,c;
cin>>x>>e;
c = cotan(x,e);
int n = 0;
x = c;
while (f(x)>e)
{
x = x/10;
n++;
}
cout.precision(n);
cout<<c;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKbG9uZyBkb3VibGUgZihsb25nIGRvdWJsZSBzKSAvL9C80L7QtNGD0LvRjCDRh9C40YHQu9CwCnsKCWlmIChzPDApIHM9LXM7CglyZXR1cm4gczsKfQoKbG9uZyBkb3VibGUgY290YW4gKGxvbmcgZG91YmxlIHgsIGxvbmcgZG91YmxlIGUpCnsKCWxvbmcgZG91YmxlIHNpbj14LCBjb3M9MSwgY290YW49MCwgYT0xOwoJaW50IG49MjsKCXdoaWxlIChmKGNvcy9zaW4tY290YW4pPmUpCgl7IAoJCWNvdGFuID0gY29zL3NpbjsKCQlhKj0teCp4Lygobi0xKSpuKTsKCQljb3MrPSBhOwoJCXNpbis9IGEqeC8obisxKTsKCQluKz0yOwoJfQoJY290YW4gPSBjb3Mvc2luOwoJcmV0dXJuIGNvdGFuOwp9CgppbnQgbWFpbigpCnsKCWxvbmcgZG91YmxlIHgsZSxjOwoJY2luPj54Pj5lOwoJYyA9IGNvdGFuKHgsZSk7CglpbnQgbiA9IDA7Cgl4ID0gYzsKCXdoaWxlIChmKHgpPmUpCgl7CgkJeCA9IHgvMTA7CgkJbisrOwoJfQoJY291dC5wcmVjaXNpb24obik7Cgljb3V0PDxjOwoJcmV0dXJuIDA7Cn0=