jakaria_hossain

lightoj - 1311 - Unlucky Bird

Aug 23rd, 2019
122
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main()
  5. {
  6. int te;
  7. cin>>te;
  8. for(int t=1;t<=te;t++)
  9. {
  10. double v1,v2,v3,a1,a2,dis,d;
  11. cin>>v1>>v2>>v3>>a1>>a2;
  12. dis=v3*max(v1/a1,v2/a2);
  13. d=(v1*v1)/(2*a1)+(v2*v2)/(2*a2);
  14. cout<<"Case "<<t<<": "<<setprecision(9)<<fixed<<d<<" "<<dis<<endl;
  15. }
  16. }
RAW Paste Data