Lang:G++
Edit1234567891011121314#include <cstdio>#include <cmath>#define eps 0.00000001double a,b,c,x,y;double getf(double x0){double t=a*x0*x0+b*x0+c;return sqrt((x-x0)*(x-x0)+(y-t)*(y-t));}int main(){scanf("%lf%lf%lf%lf%lf",&a,&b,&c,&x,&y);double l=-200,h=200;while(h-l>=eps){double lm=(l+h)/2,rm=(lm+h)/2;if(getf(lm)>getf(rm)) l=lm;else h=rm;}printf("%.3lf\n",getf(l));return 0;}