编程介的小学生 2017-10-04 02:15 采纳率: 20.3%
浏览 683
已采纳

Ebbinghaus method

Description

Facer is going to have CET6 test! To prepare for the test, he bought a vocabulary book and divided it to 30 wordlist each contains about 60 words. However, this amount is too large for Facer because of his poor IQ. Recently, he found Ebbinghaus method, a famous way of memorizing. The method is like this: we label the day we first memorize the wordlist as first day, then we need to review the words in day 2, day 4, day 8,day 15 and day 30. After that, we will not forget them. Suppose memorizing a wordlist for the first time costs 1 hour and 20 minutes and reviewing costs 40 minutes. Now Facer wants a schedule of memorizing satisfying 2 conditions: 1) He can memorize all the words as soon as possible; 2) the memorizing time in each day should be no more than 2 hours. Now your task is to calculate how many days he needs to memorizing all words. Notice that Facer always memorize all the wordlist in sequence. For example, he will never memorize the third wordlist before the second one.

Input

The first line of the input contains n, m. n stands for the number of wordlist and m stand for the number of times Facer needs to review each wordlist.
Then next line contains an ascending integer sequence contains a1, a2, ..., am indicating on which day Facer needs to review the wordlist. The day is calculated from the day he first memorize it.
1 ≤ n, m ≤ 1000
ai+1 - ai ≤ 100
1 ≤ a1 ≤ 100

Output

Output the number of days Facer needs to memorizing all wordlists.

Sample Input

5 5
2 4 8 15 30
Sample Output

36

  • 写回答

1条回答 默认 最新

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

报告相同问题?

悬赏问题

  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源