Go: package main

import (
	"fmt"
	"os"
	"strconv"
	"bufio"
	"strings"
)
func main2(){
ans(10,3,50,4,60)
ans(10 ,3, 100, 5, 180)//360
ans(6, 2, 200, 3, 300)// 600

}

func main() {



    sc := bufio.NewScanner(os.Stdin)
     sc.Scan()
        args := strings.Split(sc.Text(), " ")
      

	var n, a, b, c, d int

	n, _ = strconv.Atoi(args[0])
	a, _ = strconv.Atoi(args[1])
	b, _ = strconv.Atoi(args[2])
	c, _ = strconv.Atoi(args[3])
	d, _ = strconv.Atoi(args[4])

        ans(n,a,b,c,d)
}

func ans(n,a,b,c,d int){

	ans2 := 0
	for i := 0; i < 1000; i++ {
		if i*a >= n {
			ans2 = i * b
			break
		}
	}

	for i := 0; i < 1000; i++ {
	
		if i*c >= n {
			if ans2 > i*d {


				ans2 = i *  d
			}
			break
		}
	}

	fmt.Printf("%d\n", ans2)
}

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;
}