• [1269] Kha'Zix's Skull

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Kha'Zix and Rengar are a pair of enemies.
    Rengar can collect a Kha'Zix' Skull after he killed him.

    But you know, every game may appear a Kha'Zix. So Rengar may collect lots of skull.
    Because the shoddy design of Riot, the skull sometimes is big but sometimes small. Rengar's necklace is not too long. He wants to let the necklace leaves as less as possible space.
    Now give you some Kha'Zix' Skull's radius and the length of Rengar's necklace. You should tell Rengar that how much space should Rengar leave?
  • 输入
  • This problem contains several cases.
    The first line of each case contains two integers L and N (0 < L <= 1000, 0 < N <= 1000). Indicate the length of necklace and the number of Kha'Zix' Skulls.
    Then N lines followed. Each line is an integer, indicates the radius of each skull (not exceed 500).
  • 输出
  • For each case, you should the minimum space Rengar should leave for the necklace.
  • 样例输入
  • 15 3
    6 2 5
  • 样例输出
  • 1
  • 提示
  • 来源
  • XadillaX
  • 操作