CHECHOC WA

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main(int argc, char const argv[])
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;
cin>>t;
while(t–)
{
ll m,n;
ll x,y;
cin>>m>>n>>x>>y;
ll a=n/2;
ll ans=0;
ll f=2
x;
ans+=(amin(y,f));
ans
=m;

	if(n%2==1)
	{
	    ans+=((m/2)*(min(f,y)));
	    if(m%2==1)
	    {
	        ans+=min(x,y);
	    }
	}
	cout<<ans<<"\n";
}
return 0;

}

check for n=1 m=1 and x>y.The answer should be x