QOJ.ac

QOJ

Limite de temps : 5 s Limite de mémoire : 256 MB Points totaux : 100

#6575. Lighting

Statistiques

The Ministry of Infrastructure of Byteland has planned a modernization of the country's most important road – the A32 motorway connecting Bajtoły Dolne with Bitowice. The first stage of the modernization will be the construction of streetlights along the entire length of the A32 motorway.

The A32 motorway is divided into $n$ one-kilometer segments. In each of the $n$ consecutive weeks, lighting will be installed on one segment. The ministry's plan assumes that at any given moment, the as-yet unlit part of the motorway will form a single contiguous segment.

By default, the segments are to be built starting from those located closest to Bajtoły Dolne (where the Minister of Infrastructure comes from). However, at the beginning of each week, with probability $p$, exceptional circumstances may occur. In that case, work is directed to the segment located closer to Bitowice.

In the project documentation, for each segment, you must provide the expected number of weeks after which that segment will be lit.

Input

The first line of input contains an integer $n$ ($1 \le n \le 50\,000$), representing the number of motorway segments. The segments are numbered from $1$ to $n$, starting from the segment located closest to Bajtoły Dolne.

The second line of input contains a real number $p$ ($0 \le p \le 1$) with at most two decimal places.

Output

You should output $n$ lines. The $i$-th line should contain a single real number – the expected number of weeks after which the $i$-th segment of the A32 motorway will be lit. The result will be considered correct if the number differs from the correct answer by at most $10^{-6}$.

Examples

Input 1

5
0.25

Output 1

1.3320312500
2.6406250000
3.7734375000
4.2031250000
3.0507812500

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.