#include #include #include #include using namespace std; const double eps=1e-6; int dcmp(double x) { if(fabs(x)height) { tmp-=(height-prey)*d1/2; y=height; x=width-tmp*2/y; } } else if(dcmp(prex)==0) { x=0; y=prey-2*tmp/door; } } else { y=height; x=prex-tmp*2/height; if(x<0) { tmp=tmp-prex*prey/2; x=0; y=height-tmp*2/door; } } prex=x; prey=y; printf("%.3lf %.3lf ",x,y); } printf("\n"); } return 0; }