P1920 Success Password

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.

Description

Given a real number $x$ and a positive integer $N$, compute: $$\sum_{i=1}^{N}\dfrac{x^{i}}{i}.$$

Input Format

One line containing two numbers $x, N$.

Output Format

Output one number representing the answer. Print the result with $4$ decimal places.

Explanation/Hint

For $30\%$ of the testdata, $N \le 10^{6}$. For $100\%$ of the testdata, $1 \le N \le 10^{18}$, $0 < x \le 1$, and $x$ has at most $4$ decimal places. Translated by ChatGPT 5