link: https://www.urionlinejudge.com.br/judge/en/problems/view/2516

To get fit until next summer, you and your friend decided to run on the streets in the campus every morning. Usually, you run together. However, today your friend started running early and, hence, he is a little ahead of you now.

Right now, your friend is **S** meters away from you. You are running at a constant speed of **v _{a}** meters per second, and your friend is running at a constant speed of

**v**meters per second. The following figure shows the situation:

_{b}Your task is to determine whether you will reach your friend, and, if so, how many seconds it will take.

## Input

The input contains several test cases. The only line in each test case contains three integers **S**, **v _{a}** and

**v**(1 ≤

_{b}**S**,

**v**,

_{a}**v**≤ 10

_{b}^{3}), the current distance between you and your friend (in meters), your speed (in meters per second) and your friend’s speed (in meters per second), respectively.

The input ends with end-of-file (EOF).

## Output

For each test case, if you cannot reach your friend, print a line containing “*impossivel*” (without quotes). Otherwise, print a line containing the time it takes, in seconds, for you to reach your friend. Round and print the answer with exactly two decimal places.

Input Sample | Output Sample |

1 2 1 2 3 4 |
1.00 impossivel |

solution:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#include <stdio.h> #include <iomanip> #include <iostream> using namespace std; int main() { int s, vm, va; while(scanf("%d%d%d", &s, &vm, &va) != EOF){ double t = (double)s/(vm - va); if (t < 0) { cout << "impossivel\n"; } else { cout << fixed << showpoint; cout << setprecision(2) << t << "\n"; } } return 0; } |

thankssss