QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#9752. Covering a Ring

Statistics

Given a ring with $N$ points, labeled $1, 2, \dots, N$. Each time, a segment of length $L$ is used to cover points on the ring. The starting position of the segment is chosen uniformly at random from $1, 2, \dots, N$. Points on the ring can be covered multiple times. What is the expected number of segments required to cover the entire ring?

Input

A single line containing two integers $N$ and $L$ ($1 \le N \le 20, 1 \le L \le N$).

Output

Output a single floating-point number representing the expected number of segments required to cover the entire ring.

Your answer is considered correct if its absolute or relative error does not exceed $10^{-9}$. More precisely, if your answer is $x$ and the standard answer is $y$, your answer will be considered correct if and only if $\frac{|x - y|}{\max(1, |y|)} \le 10^{-9}$.

Examples

Input 1

3 2

Output 1

2.500000000000000

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.