luogu#P1920. 成功密码

成功密码

Background

void_rank borrowed someone else's book to read. Originally, they wanted to slack off by reading a magazine, but accidentally picked up the wrong one and ended up with a high school mathematics magazine called "Success Password," which their advisor described as a "side path." With poor math skills, void_rank really cannot handle these strange problems using mathematical methods, so they came to ask you.

Problem Description

Given a real number xx and a positive integer NN, compute:

i=1Nxii.\sum_{i=1}^{N}\dfrac{x^{i}}{i}.

Input Format

One line containing two numbers x,Nx, N.

Output Format

Output one number representing the answer.

Print the result with 44 decimal places.

1 1
1.0000

Hint

For 30%30\% of the testdata, N106N \le 10^{6}.

For 100%100\% of the testdata, 1N10181 \le N \le 10^{18}, 0<x10 < x \le 1, and xx has at most 44 decimal places.

Translated by ChatGPT 5