我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Peter's smokes

Description

Peter has n cigarettes. He smokes them one by one keeping all the butts. Out of k > 1 butts he can roll a new cigarette.
How many cigarettes can Peter have?
Input

Input is a sequence of lines. Each line contains two integer numbers giving the values of n and k.
Output

For each line of input, output one integer number on a separate line giving the maximum number of cigarettes that Peter can have.
Sample Input

4 3
10 3
100 5
Sample Output

5
14
124

http://blog.csdn.net/akof1314/article/details/4368284

http://blog.csdn.net/qiqijianglu/article/details/7933005

近期文章

  • Battle Ships
  • 请问如何配置Apache-apollo,使局域网内用户都可访问呢?
  • 在一行包含英文和中文字符串中,如何判断中文字段??
  • Multiply
  • 为什么请求进不去controller
  • Heavy Cargo
  • mysql group by 得到的最大值和最小值怎么去判断
  • 下面这个程序中,如果ch=\n或ch=b或ch=c或ch=h会怎么样
  • php访问sqlserver数据库
  • 网页第一次调用摄像头可以,同一个方法第二次就不行。可能和civil有关
  • 如何选择合适的分布式框架?要注意那些方面的问题?
  • 小白提问几个关于C51单片机程序的问题
  • java编译报这个错如何解决
  • 怎么解决弹出popwindow的同时,手机自动弹出虚拟按钮的问题
  • 2块W5500以太网模块相互通信失败
  • c++ 关于sort 函数的问题
  • Advanced Fruits
  • Zipper
  • 支付宝有密退款接口一直说正在检测
  • 在map中,如何找出value的最大值

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华