Advertisement
juanjo12x

UVA_10773_Back_To_Intermediate

Aug 9th, 2014
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4. #include <cstring>
  5. #include <string>
  6. #include <cctype>
  7. #include <stack>
  8. #include <queue>
  9. #include <list>
  10. #include <vector>
  11. #include <map>
  12. #include <set>
  13. #include <sstream>
  14. #include <stdlib.h>
  15. #include <cmath>
  16. #define LL unsigned long long
  17. using namespace std;
  18.  
  19. int main()
  20. {
  21.     int test,i;
  22.     double d,u,v,t1,t2,x,y;
  23.     scanf("%d",&test);
  24.     for(i=1; i<=test; i++)
  25.     {
  26.         scanf("%lf %lf %lf",&d,&v,&u);
  27.         t1=d/u;
  28.         x=u*u-v*v;
  29.         y=sqrt(x);
  30.         t2=d/y;
  31.         if(u!=0.0 && v!=0.0 && u>v)
  32.             printf("Case %d: %.3lf\n",i,t2-t1);
  33.         else
  34.             printf("Case %d: can't determine\n",i);
  35.     }
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement