Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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

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

func main() {
	scanner.Split(bufio.ScanWords)

	n := 5
	array := make([]float64, n)
	for i := 0; i < n; i++ {
		array[i], _ = nextFloat64()
	}

	// fmt.Println(array)
	fmt.Println(int(array[0] - math.Ceil(math.Max(array[1]/array[3], array[2]/array[4]))))
}

C++: #include <algorithm>
#include <cmath>
#include <iostream>

using namespace std;

int main()
{
    int l;
    int a;
    int b;
    int c;
    int d;
    cin >> l;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;

    cout << (l - max(static_cast<int>(ceil(static_cast<double>(a) / c)),
                     static_cast<int>(ceil(static_cast<double>(b) / d))))
         << endl;
}

C++: #include<stdio.h>
int main()
{
	int a, b, c, d, e,i,o=0;
	scanf("%d %d %d %d %d", &a, &b, &c, &d, &e);
	while (1){
		o++;
		b -= d;
		c -= e;
		if (b <= 0 && c <= 0){
			break;
		}
		
}
	a = a - o;
	printf("%d\n",a );
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
     
int main(){
  int a,b,c,d,l,A,B;
  cin>>l>>a>>b>>c>>d;
  if(a%c==0){
    A=a/c;
  }else{
    A=a/c+1;
  }
  if(b%d==0){
    B=b/d;
  }else{
    B=b/d+1;
  }
  if(A>B){
    cout<<l-A<<endl;
  }else{
    cout<<l-B<<endl;
  }
  return 0;
}

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

int main(){
	int L,A,B,C,D;
	cin>>L>>A>>B>>C>>D;
	cout<<L-(max((A-1)/C+1,(B-1)/D+1))<<endl;
	return 0;
}

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

int main () {
	int a,b,c,d,L;
	int hi,tuki;
	float fhi,ftuki;
	cin >> L >> a >> b >> c >> d;
	hi=a/c;
	fhi=(float)a/c;
	tuki=b/d;
	ftuki=(float)b/d;
	if(hi<fhi){
		fhi++;
		}
	if(tuki<ftuki){
		ftuki++;
		}
	if(hi>tuki){
		cout << L-hi <<'\n';
	}else{
		cout << L-tuki <<'\n';
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int L, A, B, C, D;
int rA = 0, rB = 0;
int main(){
cin >> L >> A >> B >> C >> D;
if( A - (A/C) * C > 0) { rA = 1;}
if( B - (B/D) * D > 0) { rB = 1;}
cout << L - max((A/C) + rA,(B/D) +rB ) << endl;
return 0;
}

C++: #include <iostream>

using namespace std;

int main(void){
    int days, A, B, maxA, maxB;
	cin >> days;
	cin >> A;
	cin >> B;
	cin >> maxA;
	cin >> maxB;

	int dayA = (A % maxA == 0) ? (A / maxA) : (A / maxA + 1);
	int dayB = (B % maxB == 0) ? (B / maxB) : (B / maxB + 1);
	int dayHw = days - ((dayA >= dayB) ? dayA : dayB);

	cout << dayHw << endl;
}

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

int main(){
  int l;
  int a,b;
  int c,d;
  int ans;
  int j,m;

  scanf(" %d %d %d %d %d",&l,&a,&b,&c,&d);

  j = m = 0;
  if(a%c!=0){
    j=1;
  }
  if(b%d!=0){
    m=1;
  }

  ans = max(a/b+j,b/d+m);

  printf("%d\n",l-ans);

  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int l, a, b, c, d;
	cin >> l >> a >> b >> c >> d;
	int n = max( (a+c-1)/c, (b+d-1)/d );
	cout << l-n << endl;
	return 0;
}

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

int main() {
  int h, j, m, j1,m1, x, y;
  cin >> h >> j >> m >> j1 >> m1;

	if(j%j1 >= 1){
	x = j/j1 + 1;
}
        else{
	x = j/j1;
}

	if(m%m1 >= 1){
	x = m/m1 + 1;
}
        else{
	x = m/m1;
}

int z =max(x,y)

  cout << h - z << endl;
  
  return 0;
}

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

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

int main(){
  double L, A, B, C, D;
  cin >> L >> A >> B >> C >> D;
  cout << L - max(ceil(A/C), ceil(B/D)) << endl;
}

C++: #include<iostream>
using namespace std;
int main() {
    int day, japa, math, do_japa, do_math, holi = 0, do_day_japa, do_day_math;
    cin >> day >> japa >> math >> do_japa >> do_math;
    if (japa%do_japa == 0) {
        do_day_japa = japa / do_japa;
    }
    else {
        do_day_japa = japa / do_japa + 1;
    }
    if (math%do_math == 0) {
        do_day_math = math / do_math;
    }
    else {
        do_day_math = math / do_math + 1;
    }
    if (do_day_japa > do_day_math) {
        holi = day - do_day_japa;
    }
    else {
        holi = day - do_day_math;
    }
    cout << holi << endl;
    return 0;
}

C++: #include <cstdio>

int main (int argc, char const* argv[])
{
	int a,b,c,d,l;
	scanf("%d%d%d%d%d",&l,&a,&b,&c,&d);
	
	a=(a-1)/c+1;
	b=(b-1)/d+1;
	
	if(a>b)l=l-a;
	else l=l-b;
	
	printf("%d\n",l);
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e,f,g;
    cin>>a>>b>>c>>d>>e;
    if(b%d==0)  f=b/d;
    if(b%d!=0)  f=b/d+1;
    if(c%e==0)  g=c/e;
    if(c%e!=0)  g=c/e+1;
    if(f<=g)    cout<<a-g;
    if(f>g) cout<<a-f;
    cout<<endl;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
  int L, A, B, C, D;
  cin >> L >> A >> B >> C >> D;
  cout << L - max((A + (A%C != 0)*(C - A%C)) / C, (B + (B%D != 0)*(D - B%D)) / D) << endl;
  return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
#define Would
#define you
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
long long fac[200005], finv[200005], inv[200005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge> >G;

int main() {
	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;
	int j, m;
	if (b%d != 0) j = b / d + 1;
	else j = b / d;
	if (c%e != 0) m = c / e + 1;
	else m = c / e;
	cout << a - max(j, m) << endl;
}

C++: #include <iostream>

using namespace std;

int main(void){
  int L , A , B , C , D;
  cin >> L , A , B , C , D;

  int days_jp , days_mt , days;
  days_jp = (A / C) + 1;
  days_mt = (B / D) + 1;
  days = (days_jp > days_mt) ?  days_jp : days_mt;

  cout << L - days;


  return 0;
}

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

int main(){
    int n;
    int i,j;
    int ja,ma;
    int cj,cm;
    cin >> n;
    cin >> ja >> ma;
    cin >> cj >> cm;
    for(i=0;ja>0;i++) ja -= cj;
    for(j=0;ma>0;j++) ma -= cm;
    if(i < j) cout << n - j << endl;
    else if(i > j) cout << n - i << endl;
    else cout << n - i << endl;
}

C++: #include<iostream>
using namespace std;
    
int main()
{
int L,A,B,C,D,K,E,F;
cin>>L>>A>>B>>C>>D;
E=A/C;
F=B/D;
if(A%C>0){
E+=1;
}
if(B%D>0){
F+=1;
}
if(E<F){
K=L-E;
}
else(E>F){
K=L-F;
}
cout<<K<<'\n';
return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int a, b, c, d, e;
    int japan, math;

    cin >> a >> b >> c >> d >> e;

    if (b % d != 0) {
        japan = (b / d) + 1;
    }
    else {
        japan = b / d;
    }
    if (c % e != 0) {
        math = (c / e) + 1;
    }
    else {
        math = c / e;
    }

    cout << (a - japan < a - math ? a - japan : a - math) << endl;
}

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

int main(){
  int L, A, B, C, D;
  
  cin >> L >> A >> B >> C >> D;
  
  int t;
  int a, b;
  a = A / C;
  if(A%C != 0) a++;
  b = B / D;
  if(B%D != 0) b++;
  t = max(a, b);
  cout << L-t << endl;
  return 0;
}

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

int main(){
	int l,a,b,c,d;
	scanf("%d%d%d%d%d", &l, &a, &b, &c, &d);
	printf("%d\n", l-max(a/c+(a%c!=0),b/d+(b%d!=0)));
}

C++: #include <iostream>
#include <cmath>

using namespace std;

int main() {
	int L, A, B, C, D;
	int aa, bb;
	cin >> L >> A >> B >> C >> D;
	if (A % C == 0) {
		aa = A / C;
	} else {
		aa = A / C + 1;
	}
	if (B % D == 0) {
		bb = B / D;
	} else {
		bb = B / D + 1;
	}
	cout << L - max(aa, bb) << endl;
	return 0;
}