当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2632:Samuel's NOKIA N73

题目描述
Samuel got an NOKIA N73 from his two aunts in the summer of 2007,he is so delighted that he often shows his cellphone off in public. But now he has a problem of his N73,because the appearance of his mobile phone is getting much uglier. As is known to all N73 users,N73's paint peels off easily. Due to Samuel's poor protection nearly all the paint on N73 has peeled off. So he made up his mind to do something with his cellphone. Now the cellphone seller gave him two pieces of advise:
1.Sell N73 to buy a new one due to the fact that he has not got enough money.
2.Change the appearance of his N73,but if he changed the value of his cellphone will reduce.
He has to make a decision. However,the right choice that will be made is based on the price he can get if he sells and the changing fee in case he changed N73's appearance.
Suppose the cellphone he bought at the price of x RMB,and the sell price is fixed at a RMB,if Samuel changes the appearance once the price of cellphone will be reduced by b(0<b<1).So the value of the cellphone after the change is x(1-b)^1.That is too say,if Samuel change for a second time the value is x(1-b)^2. Every time you should compare the left value with the sell price,if the former is higher than the later,Samuel will keep it for another month or he will sell it immediately. And the seller says he will change for Samuel for free.
The question is:
How many times will Samuel change the appearance of his N73 before he decide to sell it at a second hand price?
输入解释
The input consists 2 parts:
the test case's number t. For each case,the input will contains the original price of N73 x, the money a he will get if he sells,and the reducing rate b. Notice all the numbers here are integers except b.
输出解释
Output the time n Samuel will change his N73's appearance in the format of”Samuel will change the appearance for n time(s),before he decide to sell it.”
输入样例
1
3000 2000 0.1
输出样例
Samuel will change the appearance for 3 time(s),before he decide to sell it.
来自杭电HDUOJ的附加信息
Author Samuel
Recommend zty

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 灰色橙子 专场

源链接: HDU-2632

最后修改于 2020-10-25T22:55:24+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)