CF165B Burning Midnight Oil
题目描述
有一天,Vasy被委托了一个非常重要的任务:在一个晚上写一个程序。该程序由n行代码组成。Vasya已经筋疲力尽了,所以他这样工作:首先他写v行代码,喝一杯茶,然后他写行代码,再喝一杯茶,然后他再写v行......以此类推。
,表示a除以b后向下取整。若当前的值等于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 $ .