# Cake Party

Time Limit : 1 sec, Memory Limit : 262144 KB

# P[Lp[eB[

@ ̒aɃP[Lp[eB[邱Ƃɂ܂Bp[eBɂ͎ƗFlQ܂Bl̗FĺAP[L𐔐؂ꂸĂ܂BAP[L̐̍vAQ҂̐ł҂芄肫邩͂킩܂B

P[LFłł邾ɕ̂ŁÂ悤Ƀ[߂܂BP[L͂܂FɂȂ悤ɕ܂B̌ʗ]肪oꍇ́Ap[eB̎ł鎄DIɈ؂炤Ƃɂ܂B͉؂̃P[L炦ł傤H

Fl̐ƃP[L̏񂪗^ꂽƂA炦P[L̐߂vO쐬BAFl̐ɂ͎gĂȂƂɒӂB

͈͂ȉ̌`ŗ^B

$N$ $C$
$p_1$ $p_2$ ... $p_C$

PsڂɃp[eBɎQĂFl̐$N$ ($1 \leq N \leq 100$)ƃP[LĂFl̐$C$ ($1 \leq C \leq N$)^BPsɁAP[LĂFl̂A$i$Ԗڂ̗FlĂP[L̐ $p_i$ ($1 \leq p_i \leq100$) ^B

5 4
5 5 6 5

4

7 5
8 8 8 8 8

5

100 3
3 3 3

1