My issue
can some one tell me which test case it is failing
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, m, h;
cin >> n >> m >> h;
int a[n];
int b[m];
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < m; i++) cin >> b[i];
sort(a, a + n, greater<int>());
sort(b, b + m, greater<int>());
long ans = 0;
for (int i = 0; i < min(n, m); i++) {
ans += min(a[i], h * b[i]);
}
cout << ans << endl;
}
}
Learning course: Greedy Algorithms
Problem Link: EVacuate to Moon Practice Problem in Greedy Algorithms - CodeChef