[Zhengqing] [1770] Lovely Ball

Problem Description

Lovely Ball
Time limit: 1 SecMemory limit: 128 MB

Description

Xiaoming is doing an experiment about small balls, but he is too clumsy, so he begs a great master like you (orz) for help.

The experiment he is doing is like this: in a cylindrical tube of length _1 (assuming both ends are sealed and the radius is the same as that of the small balls), two small balls start from the two ends of the tube and move toward each other at speeds p (assuming it starts from the left) and Q (assuming it starts from the far right). After they meet, there is no loss of kinetic energy and they immediately reverse direction at their original speeds; after hitting the two ends, they likewise suffer no loss of kinetic energy and continue to reverse direction at their original speeds, repeating this forever.

Can you tell him the distance from the left end to the position where the two small balls meet for the second time?

Input

Single test case. The input consists of three real numbers 1(1 <= 1 <= 1000),p,α(1 <=p,α<= 500).

Output

Output a decimal number, representing the distance from the left end to the position where the two small balls meet for the second time, rounded to three decimal places.

Sample Input

1
100 50 50

Sample Output

1
50.000

Problem Analysis

A problem that tests your IQ~
Hahaha
Math or physics problem

cpp
1
2
3
4
5
6
7
8
#include<stdio.h>
int main() {
	double l,p,q;
	while(scanf("%lf %lf %lf",&l,&p,&q)!=EOF) {
		printf("%.3lf\n",l*(p/(p+q)));
	}
	return 0;
}

Problem link: 【ZZULI】[1770]Lovely Ball

Loading...