编程介的小学生 2019-12-29 17:47 采纳率: 20.5%
浏览 98

Samuel's NOKIA N73

Problem Description
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?

Input
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
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.”

Sample Input
1
3000 2000 0.1

Sample Output
Samuel will change the appearance for 3 time(s),before he decide to sell it.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器