编程介的小学生 2017-10-15 00:24 采纳率: 20.5%
浏览 1346
已采纳

Quantity of White Mice

Description

There is a species of white mouse to be used in experiments. The mice keep alive only n months after their birth (9 < n < 13, n is natural number, the month to be calculated from the mice's birth, for example, the mice born in Jan have been existed 4 months in Apr.). They begin giving birth to new mice from the 7-th month. In the period of the 7-th and 8-th months every pair of the parent mice give birth to one pair of mice. From the 9-th month in a period of m months (0 < m < 3, m is natural number) every pair of the parent mice give birth to two pairs of mice. Thereafter, they stop giving birth and live to the end of their life; they die at the beginning of n+1-th month. (The n+1-th month doesn't be calculated as exist time of the mice), and the died mice will be took out from this lab. In each month, the number of living mice from previous month is countered first. If the number of the living mice from the previous month is less than or equal to 100 pairs, the new born mice of this month will stay in this lab, if the number of living mice exceeds 100 pairs, the new born mice of this month will be moved to another laboratory. Let there be only one pair of newborn mice at the beginning. How many pairs of mice in the k-th month in this lab (0 < k < 37, k is a natural number)?
Input

On every line, a group of data is given. In each group there are three natural number n,m,k, separated by commas. After all data are given there is -1 as the symbol of termination.
Output

Find the number of white mice according to the input data in each group. One line is for every output. Its fore part is a repetition of the input data and then it follows a colon and a space. The last part of it is the computed number of the white mice.
Sample Input

10,1,6
10,1,7
10,1,9
10,1,10
10,1,11
-1
Sample Output

10,1,6: 1
10,1,7: 2
10,1,9: 5
10,1,10: 5
10,1,11: 4

  • 写回答

1条回答 默认 最新

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

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?