#include <stdio.h>
#include <stdlib.h>
#define int long long
int min(int a, int b){
if(a < b){
return a;
}
else{
return b;
}
}
signed main(){
int Q, H, S, D, N, ans = 0;
scanf("%lld%lld%lld%lld%lld", &Q, &H, &S, &D, &N);
int Qx8 = 8 * Q, Hx4 = 4 * H, Sx2 = 2 * S;
if(D < Sx2 && D < Hx4 && D < Qx8){
ans += D * (N / 2);
if(N % 2 == 1){
ans += min(min(4 * Q, 2 * H), S);
}
}
else{
ans += N * min(min(4 * Q, 2 * H), S);
}
printf("%lld\n", ans);
return 0;
}
./Main.c: In function ‘main’:
./Main.c:17:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld%lld%lld%lld%lld", &Q, &H, &S, &D, &N);
^