Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- int main()
- {
- int te;
- cin>>te;
- for(int t=1;t<=te;t++)
- {
- double v1,v2,v3,a1,a2,dis,d;
- cin>>v1>>v2>>v3>>a1>>a2;
- dis=v3*max(v1/a1,v2/a2);
- d=(v1*v1)/(2*a1)+(v2*v2)/(2*a2);
- cout<<"Case "<<t<<": "<<setprecision(9)<<fixed<<d<<" "<<dis<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment