#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int test;
double v1, v2, v3, a1, a2, t, t1, t2, fly, s;
cin >> test;
for(int i = 1; i <= test; i++)
{
cin >> v1 >> v2 >> v3 >> a1 >> a2;
t1 = v1 / a1;
t2 = v2 / a2;
t = max(t1, t2);
fly = v3 * t;
s = v1 * t1 + 0.5 * -a1 * t1 * t1;
s += v2 * t2 + 0.5 * -a2 * t2 * t2;
cout << fixed << setprecision(9) << "Case " << test << ": " << s << " " << fly << endl;
}
return 0;
}
ahmed shuvo969
#include<iomanip>
using namespace std;
int main()
{
int test;
double v1, v2, v3, a1, a2, t, t1, t2, fly, s;
cin >> test;
for(int i = 1; i <= test; i++)
{
cin >> v1 >> v2 >> v3 >> a1 >> a2;
t1 = v1 / a1;
t2 = v2 / a2;
t = max(t1, t2);
fly = v3 * t;
s = v1 * t1 + 0.5 * -a1 * t1 * t1;
s += v2 * t2 + 0.5 * -a2 * t2 * t2;
cout << fixed << setprecision(9) << "Case " << test << ": " << s << " " << fly << endl;
}
return 0;
}
ahmed shuvo969
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন