Advertisement
Saleh127

UVA 10522

Apr 14th, 2021
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7.  
  8.  
  9.  
  10. int tt;
  11.  
  12. scanf("%d",&tt);
  13.  
  14. while(tt>0)
  15. {
  16. double s,a,b,c,d,e,f;
  17.  
  18. scanf("%lf %lf %lf",&a,&b,&c);
  19.  
  20.  
  21. d=1.00/a;
  22. e=1.00/b;
  23. f=1.00/c;
  24.  
  25. s=(d+e+f)*(d+e-f)*(d+f-e)*(e+f-d);
  26.  
  27. if(a==0 || b==0 || c==0 || s<=0)
  28. {
  29. printf("These are invalid inputs!\n");
  30. tt--;
  31. }
  32.  
  33. else
  34. {
  35. s=sqrt(s);
  36. printf("%.3lf\n",1.0/s);
  37. }
  38.  
  39. }
  40.  
  41.  
  42. return 0;
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement