>>507
#include <stdio.h>
#include <math.h>
void divhalf(double *, double *,double a,double c);
double f(double x, double a,double c);

main(){
double a,c,x,x_1,x_2,xm,nc=0;
scanf("%f",&a); scanf("%f",&c);
scanf("%f",&x_1); scanf("%f",&x_2);

while(nc<50){
divhalf(&x_1,&x_2,a,c);
xm=(x_1+x_2)/2;
printf("%d %f %f %f\n",nc, x_1,x_2, f(xm,a,c));
if(abs(f(xm,a,c))< 0.000001)break;
}

}

void divhalf(double *x_1, double *x_2,double a,double c){
double x_m=(*x_1+*x_2)/2;
if(f(*x_1,a,c)*f(x_m,a,c)>0)
*x_1=x_m;
}


double f(double x, double a,double c){return tan(c*x)-a;}