编程介的小学生 2017-04-20 14:27 采纳率: 20.5%
浏览 881
已采纳

Apple Pile

It was a golden autumn day when Wyest got so many apples in her house. Those cute round things seemed to be so sweet and crunchy that she loved them very much. She piled them up like a pyramid, putting one apple upon every three apples which form a equilateral triangle (the picture shows a two-leveled pile). All apples were piled into the pyramid exactly, with no surplus. Then she left and planned to come back and pick one apple to eat every noon.

Unfortunately Wyest's house was not suitable for storing fruits, and at the very night she left, the apple in one corner of the bottom level began to rot. An apple always rot more by x percent each day. If a rotting apple was touching some good apples, it would cause them also begin to rot the next day. If it was only touching other rotting apples, it would make them to rot y percent more each day, and different apples would take effect separately. Of course when an apple becomes 100% rotten, it will not rot more. As Wyest was satisfied of the pyramid, she would be careful not to take any apple in the bottom of some other apple, for doing this would cause slippping or even destroy the shape. She would only take completely good ones to eat, and if she couldn't find any such apple on the top, she'd throw some until a good one could be taken. 100% rotten apples could be thrown away freely, as long as they didn't have other apples on them. Now you're to find out at most how many apples Wyest could actually eat in the end.

Input

There are multiple test cases, each on one line containing three integers: 0 < n <= 100000, the number of levels in the apple pile, 0 < x <= 100 and 0 <= y <= 100, which are discribed previously.

Output

One line for each case, a single integer indicating the number of apples Wyest could eat at most.

Sample Input

1 10 10

Sample Output

0

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-05-05 04:17
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试