编程介的小学生 2016-12-30 15:53 采纳率: 20.5%
浏览 914
已采纳

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.

输出:

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.
样例输入:

1
3000 2000 0.1
样例输出:

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

  • 写回答

1条回答 默认 最新

  • threenewbee 2016-12-30 15:55
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂