Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define suni ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
- #define endl "\n"
- #define mn int main()
- #define frac() cout.unsetf(ios::floatfield);cout.precision(6);cout.setf(ios::fixed,ios::floatfield);
- typedef long long ll;
- mn
- {
- suni;
- int t; cin>>t;
- for(int i=1;i<=t;i++){
- double x,y,c;
- cin>>x>>y>>c;
- double l=0,r=min(x,y);
- for(int i=1;i<=100;i++){
- double d=(l+r)/2.0;
- double h1=sqrt((x*x)-(d*d));
- double h2=sqrt((y*y)-(d*d));
- double h=((h1*h2)/(h1+h2));
- if(h>c) l=d;
- else r=d;
- }
- frac();
- cout<<"Case "<<i<<": "<<l<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement