Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define in() freopen("Inp.txt", "r", stdin)
- #define out() freopen("Oup.txt", "w", stdout)
- int a, b;
- int m, n;
- int main()
- {
- // in();
- // out();
- int t;
- char c;
- cin>>t;
- for(int i=1;i<=t;i++){
- scanf("%d %c %d", &m,&c,&n);
- a=max(m,n);
- b=min(m,n);
- double x, y, z, d, arc;
- double ang, per;
- double l=0.0, h=1000.0;
- double mid;
- for(int j=0;j<100;j++){
- mid=(l+h)/2.0;
- y=mid;
- x=(a*mid)/b;
- d=sqrt((x*x)+(y*y));
- z=d/2;
- ang=acos(((z*z)+(z*z)-(y*y))/(2*z*z));
- arc=z*ang;
- per=((2*arc)+(2*y));
- if(per>400.000000){
- h=mid;
- }
- else{
- l=mid;
- }
- }
- double big, small;
- small=mid;
- big=sqrt((d*d)-(small*small));
- // printf("rad=%.6lf ang=%.6lf arc=%.6lf\n", z, ang, arc);
- printf("%.8lf %.8lf\n", big, small);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment