#include <stdio.h>
#include <math.h>
int main()
{
double x, y, t,tmp,n;
int i=2, m = 1,flag=1;
scanf("%lf%lf", &x, &n);
y = x;
t = x;
tmp = x;
while (flag)
{
t *= x * x;
m *= 2 * (i - 1)*(2 * i - 1);
tmp = t / m;
if(tmp<n)flag=0;
if (i % 2 == 0) {
tmp *= -1;
}
y += tmp;
i++;
}
printf("%d %.9lf\n", i-1, y);
system("pause");
return 0;
}