Help ramu test case not passing

#include <bits/stdc++.h>
using namespace std;

void solve()
{

int c1, c2, c3, c4;
int n, m;

if (c4 < c1 && c4 < c2 && c4 < c3)
{
    cout << c4 << "\n";
    return;
}
cin >> c1 >> c2 >> c3 >> c4;
cin >> n >> m;
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];
}
int tot_rickshaw_cost = 0;
for (int i = 0; i < n; i++)
{
    tot_rickshaw_cost += min((a[i] * c1), c2);
}
tot_rickshaw_cost = min(tot_rickshaw_cost, c3);
int tot_cab_cost = 0;
for (int i = 0; i < m; i++)
{
    tot_cab_cost += min((b[i] * c1), c2);
}
tot_cab_cost = min(tot_cab_cost, c3);
int tot_cost = tot_rickshaw_cost + tot_cab_cost;
tot_cost = min(tot_cost, c4);
cout << tot_cost << "\n";

}
int main()
{
int t;
cin >> t;
while (t–)
{
solve();
}
}

//what is wrong in this code it is alright to the best of my //knowledge please help

The issue is cin >> c1 >> c2 >> c3 >> c4; should be before the if condition checking c4 < c1 && c4 < c2 && c4 < c3 .

You can refer my code as well

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.