Advertisement
erfanul007

LOJ 1311

Apr 14th, 2021
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.42 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     double v1,v2,v3,a1,a2,t1,t2,s1,s2,t,s,bs;
  5.     int i,n;
  6.     scanf("%d",&n);
  7.     for(i=1;i<=n;i++){
  8.         scanf("%lf %lf %lf %lf %lf",&v1,&v2,&v3,&a1,&a2);
  9.         s1=(v1*v1)/(2*a1);
  10.         s2=(v2*v2)/(2*a2);
  11.         s=s1+s2;
  12.         t1=v1/a1;
  13.         t2=v2/a2;
  14.         t=t1;
  15.         if(t<t2)
  16.             t=t2;
  17.         bs=v3*t;
  18.         printf("Case %d: %.9lf %.9lf\n",i,s,bs);
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement