#include <iostream>
#include <cmath>
using namespace std;
double pierwiastek (double x, double eps){
double a=0.0;
double b=x;
double c;
while (fabs(b-a)>eps){
c=(a+b)/2;
if(c*c>x)
b=c;
else
a=c;
}
return c;
}
int main() {
cout<< pierwiastek(2,0.0001);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpkb3VibGUgcGllcndpYXN0ZWsgKGRvdWJsZSB4LCBkb3VibGUgZXBzKXsKCWRvdWJsZSBhPTAuMDsKCWRvdWJsZSBiPXg7Cglkb3VibGUgYzsKCXdoaWxlIChmYWJzKGItYSk+ZXBzKXsKCQljPShhK2IpLzI7CgkJaWYoYypjPngpCgkJYj1jOwoJCWVsc2UKCQlhPWM7Cgl9CglyZXR1cm4gYzsKfQppbnQgbWFpbigpIHsKCWNvdXQ8PCBwaWVyd2lhc3RlaygyLDAuMDAwMSk7CgkKCXJldHVybiAwOwp9