单点时限: 2.0 sec

内存限制: 256 MB

Tim is an absolutely obsessive soda drinker,he simply cannot get enough. Most annoyingly

though, he almost never has any money, so his only obvious legal way to obtain more soda is to take the money he gets when he recycles empty soda bottles to buy new ones. In addition to the empty bottles resulting from his own consumption he sometimes find empty bottles in the street. One day he was extra thirsty, so he actually drank sodas until he couldn’t aford a new one.

输入格式
Three non-negative integers e,f,c, where e<1000 equals the number of empty soda

bottles in Tim’s possession at the start of the day, f<1000 the number of empty soda

bottles found during the day, and 1<c<2000 the number of empty bottles required to

buy a new soda.

输出格式
How many sodas did Tim drink on his extra thirsty day?

样例
input
9 0 3
5 5 2
output
4
9

/*
模拟递归
*/
#include<iostream>
using namespace std;
int main() {int e,f,c;while(cin>>e>>f>>c) {int sum=e+f;int ans=0;while(sum>=c) {ans+=sum/c;sum=sum/c+sum%c;}cout<<ans<<endl;}return 0;
}

2690. Soda Surpler相关推荐

  1. uva11689 Soda Surpler

    uva11689 uDebug11689 题意是说,若干个soda水空瓶子可以换一瓶soda水.Tim这家伙自己手头有e个空瓶子(0<=e<1000),从外面捡来了f个空瓶子(0<= ...

  2. [解题报告]11689 - Soda Surpler

    题目大意 题目原文:http://uva.onlinejudge.org/external/116/11689.pdf 背景: Tim 是一个非常爱喝汽水的人.由于他没有钱,所以他要喝汽水的唯一方法就 ...

  3. Competitive Programming 3题解

    题目一览: Competitive Programming 3: The New Lower Bound of Programming Contests(1) Competitive Programm ...

  4. Competitive Programming专题题解(1)

    Competitive Programming题解 AOAPC I: Beginning Algorithm Contests 题解 CP2-1.1.1 Easy(Ad Hoc Problems) P ...

  5. 给自己的Sublime Text换上Soda Theme主题后清爽了好多

    自从用上了sublime写代码,主题风格就一直是默认的那款,纯黑的,时间短的话还觉得蛮酷的,但是日子一长,尤其是晚上写代码的适合,黑漆漆的一片,审美疲劳啊,所以这次就换了soda light这款,清爽 ...

  6. mysql的纵向扩展方案_SQL Server横向扩展方案-SODA

    SQL Server横向扩展方案-SODA 每次在提到SQL Server扩展性问题的时候,似乎很多的SQL Server DBA或者使用微软技术开发的朋友心里总是一整痛:SQL Server只能纵向 ...

  7. 葡萄汽水(Grape soda)

    葡萄汽水(Grape soda) 示例 HTML JS 更多有趣示例 尽在 知屋安砖社区 示例 HTML <script src="https://cdnjs.cloudflare.c ...

  8. SODA Foundation中国区启动仪式在联通沃云峰会(WCS)2019成功举行

    2019年12月20日,SODA Foundation中国区启动仪式在北京国际会议中心联通沃云峰会(WCS)2019成功举行. 启动仪式由Steven Tan先生(VP & CTO Cloud ...

  9. [usaco2010 Oct]Soda Machine (入门oj Problem 6195 )

    鬼知道我有多蒟蒻,第五次发题解了 题目原地址点此进入 呜呜呜~今天在CSDN上看了好多大佬神犇的OI退役文,百感交集,故写篇题解振奋自己. 文章目录 题目描述 输入 输出 样例输入 样例输出3 题目大 ...

最新文章

  1. simple c语言,C语言——指针(simple).ppt
  2. BZOJ4943 洛谷3823 UOJ315:[NOI2017]蚯蚓排队——题解
  3. hackme_Login As Admin 0
  4. android原生webview,Android 原生与WebView JS的交互
  5. 你是个失败者,有什么资格说话?
  6. leetcode367. 有效的完全平方数
  7. 多线程和单线程 打印数字到100000 的速度对比
  8. 再也不用担心动态规划,BAT大佬精讲42道题目,相见恨晚
  9. Web Resources on Patten Recognition
  10. vmd与ovito的对比
  11. JavaWeb重点笔记
  12. 21秋期末考试工程项目管理10324k2 (2)
  13. NDIS驱动学习笔记
  14. Acetal-PEG-NHS,NHS-PEG-Acetal,乙缩醛-聚乙二醇-琥珀酰亚胺酯化学试剂供应
  15. GLES2.0中文API-glGetUniformLocation
  16. appstore关键词优化:AppStore关键词优化的主要流程
  17. “传统文化传承人暨未来经济人才研修班”首期在山东省成功举办
  18. 惯性导航算法(五)-等效旋转矢量+双子样算法
  19. 数据可视化大屏设计尺寸怎么定?
  20. 数学分析 多元函数微分学(第17章)

热门文章

  1. 谴责那些没有良知的人
  2. 集成显卡 独立显卡 CPU核心显卡的区别
  3. AT91SAM9X5EK移植linux4sam6.1包,buildroot制作ubifs挂载成功,执行/sbin/init时提示init (1): undefined instruction
  4. 世界黑客大会演示了如何轻易破坏投票机?网友:不服真不行
  5. Linux设置开机自启
  6. Accumulation Degree题解
  7. 又一款超好用开源知识库管理工具
  8. 苹果开机是白苹果黑屏_这是苹果应如何回应史诗般的1984年诱饵
  9. java制作SM2证书
  10. 读 L. S. Stavrianos 之 《全球通史:从史前到21世纪》