fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6.  
  7. int main() {
  8. double x,y,z;
  9. double zero=0;
  10. cin>>y>>x>>z;
  11. if ((x==y)or(z==1)){
  12. cout<<"IMPOSSIBLE";
  13. }else if(z==0){
  14. cout<<y;
  15. }else {
  16. cout<<fixed;
  17. cout<<setprecision(9);
  18. zero=(y*y-x*x*z*z)/double(1-z*z);
  19. cout<<sqrt(zero);
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
6.95333e-310