#include using namespace std; int main(){ int n,k; cin >> n >> k; int ans=0; bool maina = false; vector a(101,0); for(int i=0;i> a[i]; } sort (a.begin(),a.end()); reverse (a.begin(),a.end()); if(a[0]<0) maina = true; if(maina) cout << a[0] << endl; else{ for(int i=0;i0){ ans += a[i]; } } cout << ans << endl; } }