比赛 20241127 评测结果 WAAAAAAWWW
题目名称 魔法阵 最终得分 60
用户昵称 ┭┮﹏┭┮ 运行时间 0.030 s
代码语言 C++ 内存使用 3.49 MiB
提交时间 2024-11-27 10:48:20
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int,ll>
#define fi first
#define in inline
#define se second
#define mp make_pair
#define pb push_back
const int N = 2e5+10;

ll read(){
	ll x = 0,f = 1;char c = getchar();
	for(;c < '0' || c > '9';c = getchar())if(c == '-')f = -1;
	for(;c >= '0' && c <= '9';c = getchar())x = (x<<1) + (x<<3) + c-'0';
	return x * f;
}

ll n,m,k1,k2;
ll ans = 1e17;


int main(){
	freopen("mmatrix.in","r",stdin);
	freopen("mmatrix.out","w",stdout);
	n = read(),m = read(),k1 = read(),k2 = read();
	if(n % 2 == 0)ans = min(ans,k1 * (n / 2));
	if(m % 2 == 0)ans = min(ans,k2 * (m / 2));
	printf("%lld\n",ans);

	return 0;

}