#2626. 新年灯会
新年灯会
Description
新春佳节之际,路上挂起了一排喜气洋洋的大红灯笼,从左至右编号分别为<math xmlns="http://www.w3.org/1998/Math/MathML">1,2,...,n。但小爱发现,目前有<math xmlns="http://www.w3.org/1998/Math/MathML">p个灯笼不亮了,很是影响美观。
请你帮助小爱计算,最少修复多少个灯笼,便可使道路上有连续<math xmlns="http://www.w3.org/1998/Math/MathML">m个亮着的大红灯笼?
Input Format
输入共两行:第一行,三个正整数分别表示<math xmlns="http://www.w3.org/1998/Math/MathML">n,m,p
第二行,<math xmlns="http://www.w3.org/1998/Math/MathML">p个正整数,表示已经不亮的灯笼编号
Output Format
输出共一行,一个正整数表示答案8 5 3
5 1 8
1
Hint
说明:
只需把5号灯笼修好即可
- 对于 <math xmlns="http://www.w3.org/1998/Math/MathML">30% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1≤m,p≤n≤100
- 对于 <math xmlns="http://www.w3.org/1998/Math/MathML">60% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1≤m,p≤n≤104
- 对于 <math xmlns="http://www.w3.org/1998/Math/MathML">100% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1≤m,p≤n≤105