fork(1) download
  1. #include <iostream>
  2. #include <math.h>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main() {
  7. double a,c,b;
  8. cin >> c >> a;
  9. b=sqrt(c*c-a*a);
  10. cout<< fixed << setprecision(2) << b << " " << (a+b-c)/2 << endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 3416KB
stdin
1000 758
stdout
652.25 205.13