No.926 Average Number of Holidays
タグ : / 解いたユーザー数 523
作問者 : 👑
Problem Statement
In the world where Raki lives, a year has $A$ days, a week has $B$ days, and $C$ days of each week are holidays.
Raki became curious about the average number of holidays in one year.
Please find the average number of holidays in one year for Raki.
Assume that there are no leap years, public holidays, or the like.
It can be proved that the average number of holidays does not change even if the positions of the holidays within a week change.
Input
$A\ B\ C$
$A$ is the number of days in a year ($1 \le A \le 1000$),
$B$ is the number of days in a week ($1 \le B \le 1000$),
and $C$ is the number of holidays in a week (($0 \le C \le B$).
Output
Output the average number of holidays.
Your answer is accepted if at least one of its absolute error or relative error is at most $10^{-6} $.
Sample
Sample 1
Input
365 7 2
Output
104.28571428
This is the ordinary Gregorian calendar.
As this sample shows, there are no leap years, public holidays, or the like.
Sample 2
Input
10 20 20
Output
10.00000000
A week may be longer than the one-year cycle.
Sample 3
Input
1000 7 0
Output
0.0000000
Mon Mon Tue Wed Thu Fri Fri
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。