// UVa 10773 - Back to Intermediate Math #include <iostream> #include <cmath> #include <stdio.h> using namespace std; int main() { int tt; cin >> tt; for (int t = 1; t <= tt; t++) { double d, v, u; cin >> d >> v >> u; if (u > v && v != 0) { double t1 = d / u; double t2 = d / sqrt(u * u - v * v); double p = t2 - t1; printf("Case %d: %.3f\n", t, p); } else printf("Case %d: can't determine\n", t); } return 0; }
No comments:
Post a Comment