Question: Adobe SheCodes, Online Assessment Questions | Get Maximum Cadies | 6th August 2023 #include<bits/stdc++.h>
using namespace std;
int main() {
int n;cin >> n;
vector<int> v(n); for(int i=0;i<n;i++) cin >> v[i];
sort(v.begin(), v.end());
int m=n/3;
int sum=0;
for(int i=m+1;i<=n;i+=2) {
sum+=v[i-1];
}
cout << sum <<"\n";
return 0;
}
Login before adding your answer.