Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func stringifyArray(arr []int) string {
	return strings.TrimRight(fmt.Sprintf("%+v", arr)[1:], "]")
}

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}
func main() {
	scanner.Split(bufio.ScanWords)

	n, _ := nextInt()
	a, _ := nextInt()
	b, _ := nextInt()
	c, _ := nextInt()
	d, _ := nextInt()

	costX := b * int(math.Ceil(float64(n)/float64(a)))
	costY := d * int(math.Ceil(float64(n)/float64(c)))
	fmt.Println(min(costX, costY))
}

Python: N,A,B,C,D=map(int,input().split())
print(min((N+A-1)//A*B,(N+C-1)//C*D))

Python: N,a,b,c,d=map(int,input().split())

aa=int((N+a-1)/a)
bb=int((N+c-1)/c)

cc=aa*b
dd=bb*d

if cc>dd :
    print(dd)

else :
    print(cc)

Python: N,A,B,C,D=map(int,input().split())
x=N//A
y=N//C
if x==N/A:
    X=N//A
else:
    X=N//A+1

if y==N/C:
    Y=N//C
else:
    Y=N//C+1

if X*B > Y*D:
    print(Y*D)
else:
    print(X*B)

Python: n,a,b,c,d = map(int,input().split())

xpen=0
xmoney=0
ypen=0
ymoney=0

while(xpen<n):
    xpen=xpen+a
    xmoney=xmoney+b
while(ypen<n):
    ypen=ypen+c
    ymoney=ymoney+d

if(xmoney>ymoney):
    print(ymoney)
else:
    print(xmoney)

Python: N,A,B,C,D =input().split()
if (int(N)%int(A))>0 : X = ((int(N)//int(A))+1)*int(B)
else : X = (int(N)//int(A))*int(B)
if (int(N)%int(C))>0 : Y = ((int(N)//int(C))+1)*int(D)
else : Y = (int(N)//int(C))*int(D)
if X<Y : print(X)
else : print(Y)

Python: N,A,B,C,D=map(int,input().split())
if N%A==0:
    x=N//A
else:
    x=N//A+1
if N%C==0:
    y=N//C
else:
    y=N//C+1
print(min(x*B,y*D))

Python: N,A,B,C,D=map(int,input().split())
print(min((N+A-1)//A*B, (N+C-1)//C*D))

Python: import math as m
N,A,B,C,D=(float(x) for x in input().split())

a=m.ceil(N/A)*B
b=m.ceil(N/C)*D

if a>b:
    print(int(b))
else:
    print(int(a))

Python: import math
a = input().split()
n = int(a[0])
A = int(a[1])
b = int(a[2])
c = int(a[3])
d = int(a[4])
seta = math.ceil(n / A)
setc = math.ceil(n / c)
costa = seta * b
costb = setc * d
if costa < costb:
    print(costa)
elif costb < costa:
    print(costb)
else:
    print(costa)

Python: N , A , B , C , D = map(int , input() . split())
X = -(-N // A) * B
Y = -(-N // C) * D
if X >= Y :
     print(Y)
else :
     print(X)

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  int N,A,B,C,D;
  cin>>N>>A>>B>>C>>D;
  cout<<min((N+A-1)/A*B,(N+C-1)/C*D)<<endl;
  return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int n, a, b, c, d;
	int xnum = 0, ynum = 0;
	cin >> n >> a >> b >> c >> d;
	if (n%a) xnum = (n / a) + 1;
	else xnum = n / a;
	if (n%c) ynum = (n / c) + 1;
	else ynum = n / c;
	cout << min(xnum*b, ynum*d) << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a,b,c,d,cnt=0,cnt2=0,pen1=0,pen2=0,cost=0;
	cin>>n>>a>>b>>c>>d;
	while(n>=pen1){
		pen1=pen1+a;
		cnt++;}
	while(n>pen2){
		pen2=pen2+c;
		cnt2++;}
	if(cnt2*d>cnt*b)
		cost=cnt*b;
	if(cnt*b>cnt2*d)
		cost=cnt2*d;
	if(cnt2*d==cnt*b)
		cost=cnt*b;
	cout<<cost<<endl;
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int n,a,b,c,d,ab,cd;
    cin>>n>>a>>b>>c>>d;
    ab=n/a*b;
    cd=n/c*d;
    if(n%a!=0){
        ab=ab+b;
    }
    if(n%c!=0){
        cd=cd+d;
    }
    if(ab>cd){
        cout<<cd<<endl;
    }
    else{
        cout<<ab<<endl;
    }
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

#define INF = 10000000;

int main() {
  int N, A, B, C, D, min1 = 0, min2 = 0;
  cin >> N >> A >> B >> C >> D;
  min1 += B*(N/A);
  if(N%A) {
    min1 += B;
  }
  min2 += D*(N/C);
  if(N%C) {
    min2 += D;
  }
  cout << min(min1, min2) << endl;

  return 0;
}

C++: #include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int inf=998244353;
const int mod=998244353;
int main(){
    ll n,a,b,c,d;cin>>n>>a>>b>>c>>d;
    cout<<min((n-1)/a*b+b,(n-1)/c*d+d)<<endl;
}

C++: #include <iostream>
 
using namespace std;
 
int N,A,B,C,D
int X_SET,Y_SET,X_SUM,Y_SUM;
int main(){
cin>>N>>A>>B>>C>>D;
X_SET = N/A;
if(N%A>0)X_SET=X_SET+1;
Y_SET=N/C;
if(N%C>0)Y_SET+1;
X_SUM=B*X_SET;
Y_SUM=D*Y_SET;
if(X_SUM<Y_SUM)cout<<X_SUM<<endl;
else
cout<<Y_SUM<<endl;
return0;
}

C++: #include <iostream>
int main() {
	int N, A, B, C, D, x,y;
	std::cin >> N >> A >> B >> C >> D;
	if (N%A >= 1) {
		x = N / A + 1;
	}
	else {
		x = N / A;
	}
	if (N%C >= 1) {
		y = N/ C+ 1;
	}
	else {
		y = N / C;
	}
	
	if (x*B < y*D) {
		std::cout << x * B << std::endl;
	}
	if (x*B >= y*D) {
		std::cout << y * D << std::endl;
	}
}

C++: #include <iostream>
using namespace std;
int main(){
	int i,o,s,t,r,e=1,a=1,m,q;
	cin>>i>>o>>s>>t>>r;
	m=o;
	q=t;
	while(i>m){
		e++;
		m=m+o;
	}
	while(i>q){
		a++;
		q=q+t;
	}
	s=s*e;
	r=r*a;
	if(s<=r){
		cout<<s<<endl;
	}else{
		cout<<r<<endl;
	}
return 0;
}

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


int main(){
  int min;
  int N,A,B,C,D;

  cin >> N >> A >> B >> C >> D;

  bool first_f = true;
  int kane = 0;
  int honsu = 0;
  for(int i=1; i<N/C + 2; ++i){
    int k;
    for(k=1; k<N/A + 2; ++k){
      honsu += A;
      kane += B;
      if(honsu >= N){
	if(first_f){
	  first_f = false;

	  min = kane;
	  break;
	}else{
	  if(min > kane){
	    min = kane;
	  }
	  break;
	}
      }
    }
    honsu -= k * A;
    honsu += C;
    kane -= k * B;
    kane += D;

    if(honsu >= N){
      if(min > kane){
        min = kane;
      }
      break;
    }
  }

  cout << min << endl;
  return 0;
}