#GYM104758G. Gojo Satoru

Gojo Satoru

本题没有可用的提交语言。

Description

Gojo Satoru, the strongest man alive, is fighting Sukuna in order to save humanity. Unfortunately, Gojo is losing the battle. The only option he has left to defeat Sukuna is to make a 'heavenly restriction' to gain more power.

Initially, Gojo produces one cursed energy unit every minute.

The 'heavenly restriction' allow him to do the following at the beginning of each minute:

Gojo can launch an attack, spending all the cursed energy units he has accumulated up to that point, denoted as N. Once Gojo spends these units, the rate at which he produces cursed energy units per minute becomes N. After Gojo decides to launch an attack, he must wait for M minutes before he can start producing cursed energy units again.

He can repeat this any number of times.

To defeat Sukuna, Gojo must land an attack of at least $S$ units of cursed energy.

The first line contains two numbers $S$ ($1$ $\leq$ $S$ $\leq$ $10^{12}$) and $M$ ($0$ $\leq$ $M$ $\leq$ $10^{12}$)

The shortest time needed to defeat Sukuna.

Input

The first line contains two numbers $S$ ($1$ $\leq$ $S$ $\leq$ $10^{12}$) and $M$ ($0$ $\leq$ $M$ $\leq$ $10^{12}$)

Output

The shortest time needed to defeat Sukuna.

10 4
9 0
10
6