/*input */ //__author__= "Ravi Shankar" #include using namespace std; /*******usful typedef's *********/ typedef long long ll; typedef vector vi; typedef vector vii; typedef pair ii; typedef listli; typedef list
  • lii; typedef setsi; typedef setsii; typedef map mi; /**************some useful macros/preprocessor********/ #define be_fast std::ios::sync_with_stdio(false);std::cin.tie(NULL) #define print cout << #define ict int t;cin>>t;while(t--) #define loop(a,b,c) for (int (a)=(b); (a)<(c); ++(a)) #define loopn(a,b,c) for (int (a)=(b); (a)<=(c); ++(a)) #define loopd(a,b,c) for (int (a)=(b); (a)>=(c); --(a)) #define ina(a,n) loop(i,0,n) cin>>a[i]; #define outa(a,n) loop(i,0,n) cout << a[i]<<" "; cout <>n>>k; int arr[n]; ina(arr,n); sort(arr,arr+n); int i=0; ll ans=0; while(i