#P16197. [ROIR 2014 Day 2] Lights 红绿灯

    ID: 18124 远端评测题 2000ms 256MiB 尝试: 0 已通过: 0 显示难度普及− 上传者: 标签>数学2014Special JudgeROIR(俄罗斯)

[ROIR 2014 Day 2] Lights 红绿灯

Problem Description

At the computer summer camp site, an electric scooter route has been set up. Since the scooter can go directly to the ICT center, the student Pakhom decided to try this route. Along the route, the scooter passes through two traffic lights in order at a constant speed, and it passes both when they are green. It is known that the two traffic lights are xx meters apart, and their signal changes are perfectly synchronized: green stays on for aa minutes, then red stays on for bb minutes, then it switches back to green, repeating in a cycle. There is no yellow light between red and green. The scooter’s speed will not exceed 10001000 meters per minute. The scooter is allowed to pass through the intersection at the exact moment when the light switches.

After arriving at the ICT center, Pakhom became curious about what the maximum constant speed between the two traffic lights could be.

Write a program to compute this maximum speed for Pakhom.

Input Format

The first line of the input contains three integers aa, bb, and xx, satisfying 1≤a≤1001 \le a \le 100, 1≤b≤1001 \le b \le 100, and 1≤x≤100 0001 \le x \le 100\,000.

Output Format

The output should contain only one number: the maximum speed the scooter can achieve between the two traffic lights. The absolute or relative error of the answer must not exceed 10−910^{-9}.

3 5 4000

800

5 10 21010

840.4

Hint

Scoring

For the testdata worth 5050 points, the answer is an integer.

Translation source: GPT 4.1 mini.

Translated by ChatGPT 5