P26346 [AtCoder] eject
提高-
题目描述

Problem Description

Amylase, who lives alone, suffered from a hot room when returning home in the summer. To cool down the room before returning home, Amylase decided to turn on the air conditioner from outside the house.

Amylase created a device that presses the air conditioner switch by placing it in front of the CD tray of the PC. This allows the air conditioner to be turned on and off remotely by opening and closing the CD tray.

The air conditioner switch is initially off, and pressing it once toggles the air conditioner between off and on.

However, Amylase, who was clumsy enough to receive a grade 1 in elementary school art and crafts, found out that the switch could only be pressed with a probability of $ p $ each time the CD tray is opened and closed.

Frustrated, Amylase opened and closed the CD tray $ n $ times.

Calculate the probability that the air conditioner is on at the end.

Input Format

The input is given in the following format:

$ p $ $ n $

  • The first line contains the probability $ p $ ($0 \leq p \leq 1$) of successfully pressing the switch, and the integer $ n $ ($1 \leq n \leq 10^{18}$), which represents the number of times the CD tray was opened and closed.
  • $ p $ is given up to 10 decimal places.

Output Format

Output the probability that the air conditioner is on in one line.

The answer will be considered correct if the absolute or relative error is at most $ 10^{-6} $.

End with a newline and do not include any extra characters or blank lines.

Sample Input and Output

Sample Input #1

0.3 1

Sample Output #1

0.3

Sample Input #2

0.0000000001 10000000000

Sample Output #2

0.432332358362

Notes/Hints

Sample Explanation 2

Be careful to avoid errors for extreme inputs.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
0.3 1
样例输出
0.3