#include #define Rep(i,j,n) for(li i=(j);i<(n);i++) #define rep(i,n) Rep(i,0,(n)) #define all(a) begin(a),end(a) using namespace std; typedef long int li; typedef unsigned long long ull; typedef vector vi; typedef vector vs; int main() { int l,n,ans=0,s=0; cin>>l>>n; vi w(n); rep(i,n)cin>>w[i]; sort(all(w)); for(int i:w) { s+=i; if(s