407622: GYM102861 A Sticker Album

Memory Limit:1024 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Sticker Albumtime limit per test1.5 secondsmemory limit per test1024 megabytesinputstandard inputoutputstandard output

The Sticker Album of the ICPC 2020 Nlogonian Subregional just came out! Competitive programming hooligans all over the country are buying albums and collecting stickers, to celebrate the competition.

This sticker album is special because all stickers are equal: a picture of this year's trophy. To complete the album, you just need to collect enough stickers to fill all the slots in it.

You may be asking yourself: where is the fun in collecting those stickers? Well, to make things interesting, the stickers are sold in packets, each with a random number of stickers! Fans celebrate when they find a high number of stickers in a packet, make fun of those who got unlucky and found low numbers of stickers, and brag about filling their whole albums with just a few packets.

You just acquired your own album, and want to start filling it! But before buying your first sticker packets, you wondered: on average, how many packets does one need to buy in order to fill an album?

Input

The only input line contains three integers $$$N$$$, $$$A$$$ and $$$B$$$, separated by a single space, satisfying $$$1 \le N \le 10^6$$$, $$$0 \le A \le B \le 10^6$$$ and $$$B > 0$$$, where:

  • $$$N$$$ is the number of stickers it takes to fill an album;
  • $$$A$$$ is the minimum number of stickers in a packet;
  • $$$B$$$ is the maximum number of stickers in a packet.
The number of stickers in each packet is uniformly distributed in the closed interval $$$[A, B]$$$.Output

The output consists of a single line, which must contain the expected number of packets it takes to complete an album. The number will be considered correct if it is within an absolute or relative error of $$$10^{-5}$$$ of the correct answer.

ExamplesInput
40 0 2
Output
40.33333
Input
100 1 10
Output
18.72727
Input
30 3 3
Output
10.00000
Input
314 5 8
Output
48.74556

加入题单

上一题 下一题 算法标签: