Kthrootproblem-

-++++++#include<bits/stdc++.h> using namespace std; int main() { int n,k; cin>>n>>k; int h[n]; for(int i=0;i<n;i++) cin>>h[i]; sort(h,h+n); if(k<n) { int y; if(n%2==0) y=(n/k); else y=(n/k)+1; // cout<<y<<endl; int u=0; for(int i=0;i<y-1;i++) u=u+h[i]; cout<<u+h[n-1]<<endl; } else cout<<h[n-1]<<endl; return 0; } which test case it if failing?

whatb issecond test case which it is fsailing?

ask this question in c++ section , you have asked it in Java DS

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.