fork download
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cstring>
  4. #include<cmath>
  5. using namespace std;
  6. int t;
  7. double a,b,c,x,ans,d,e;
  8. int main(){
  9. scanf("%d",&t);
  10. while(t--){
  11. scanf("%lf%lf%lf%lf",&a,&b,&c,&x);
  12. ans=sqrt((a*a)+(b+2*c)*(b+2*c));
  13. d=b/100*x;
  14. e=a/100*x;
  15. ans+=sqrt(d*d+e*e);
  16. ans+=sqrt((b-d+2*c)*(b-d+2*c)+(a-e)*(a-e));
  17. printf("%.9f\n",ans);
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 4472KB
stdin
Standard input is empty
stdout
Standard output is empty