CF165B Burning Midnight Oil

题目描述

有一天,Vasy被委托了一个非常重要的任务:在一个晚上写一个程序。该程序由n行代码组成。Vasya已经筋疲力尽了,所以他这样工作:首先他写v行代码,喝一杯茶,然后他写![](https://cdn.luogu.org/upload/vjudge_pic/CF165B/be8d069d652d51f8329016702f7c81645767ac06.png)行代码,再喝一杯茶,然后他再写![](https://cdn.luogu.org/upload/vjudge_pic/CF165B/4e3353b53aaa8dff17e86fc64d74d2d54f694513.png)v行......以此类推。 ![](https://cdn.luogu.org/upload/vjudge_pic/CF165B/ff48225f7f772c08409f2d464b02c44cf20620e2.png),表示a除以b后向下取整。若当前![](https://cdn.luogu.org/upload/vjudge_pic/CF165B/ff48225f7f772c08409f2d464b02c44cf20620e2.png)的值等于0,Vasya会睡着,但此之前他必须先完成程序。 Vasya想知道,在睡着之前,允许他写出不少于n行代码的最小值v可以取多少。

输入格式

输入一行,n和k,由空格隔开。且1

输出格式

输出一行:v。

说明/提示

In the first sample the answer is $ v=4 $ . Vasya writes the code in the following portions: first $ 4 $ lines, then $ 2 $ , then $ 1 $ , and then Vasya falls asleep. Thus, he manages to write $ 4+2+1=7 $ lines in a night and complete the task. In the second sample the answer is $ v=54 $ . Vasya writes the code in the following portions: $ 54 $ , $ 6 $ . The total sum is $ 54+6=60 $ , that's even more than $ n=59 $ .