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<stdio.h>
int main(void)
{
	int n,i,s;
	int hi;
	int koku,suu;
	int koku2,suu2;
	scanf("%d %d %d %d %d",&hi,&koku,&suu,&koku2,&suu2);
	i=0;
	n=0;
	while(koku>0){
		koku-=koku2;
		n++;
	}
	while(suu>0){
		suu-=suu2;
		i++;
	}
	if(n<=i){
		hi=hi-i;
	}
	else{
		hi=hi-n;
	}
	printf("%d\n",hi);
	return 0;
}

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

int main(){
  int a;
  int i;
  int u;
  int e;
  int o;
  int ka;
  int ki;
  cin>>a>>i>>u>>e>>o;

  ka=i/e;
  if(i%e>0){
    ka=ka+1;
  }
  ki=u/o;
  if(u%o>0){
    ki=ki+1;
  }

  cout<<a-ka-ki<endl;
}

C++: #include<stdio.h>
int main(void)
{
	int day,A,B,C,D,amari=0,a=0,b=0;
	scanf("%d",&day);
	scanf("%d",&A);
	scanf("%d",&B);
	scanf("%d",&C);
	scanf("%d",&D);
	amari=A%C;
	if(amari!=0){
		a=A/C+1;
	}
	else 
		a=A/C;
	amari=B%D;
		if(amari!=0){
		b=B/D+1;
	}
	else 
		b=B/D;
	if(a>=b){
		printf("%d",day-a);
	}
	else 
		printf("%d",day-b);
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){




int l,a,b,c,d;

cin >>l >>a >>b >>c >>d;
     
    if(a/c < b/d){ //算数にかかる日数が多いかの判定
                     if(b%d==0){cout<< l-(b/d) << endl;
                         }else{
                         cout<< l-(b/d + 1)<< endl;
                        }
    //if(b/d<a/c)
                }else{
                    
                        if(a%c==0){ cout<< l-(a/c)<< endl;
                         }else{
                        cout<< l-(a/c+1) << endl;}
                }
return 0;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;

int main()
{
	int ans = 0,len, J, M, MJ, MM;

	cin >> len >> J >> M >> MJ >> MM;

	for(int i = 1; i <= len; i++)
	{
		J -= MJ;
		M -= MM;

		if(J <= 0 && M <= 0)
		{
			ans = len - i;
			break;
		}
	}

	cout << ans << endl;
}

C++: #include <stdio.h>

int main() {
 int A, B, C, D, L, i, R, cnt = 0;
 scanf( "%d", &L );
 scanf( "%d", &A );
 scanf( "%d", &B );
 scanf( "%d", &C );
 scanf( "%d", &D );
 for( ;; ) {
   A -= C;
   B -= D;
   cnt++;
   if( A <= 0 && B <= 0 ) break;
 }
 R = L - cnt;
 printf( "%d\n", R );
 return 0;

C++: #include<iostream>
using namespace std;
int maxnum(int x,int y);
int main(){
    int vad,Jp,Js,Jd,Mp,Ms,Md,Hf;
    cin >> vad;
    cin >> Jp;
    cin >> Mp;
    cin >> Js;
    cin >> Ms;
    Jd = Jp / Js + 1;
    if(Jp % Js == 0){
        Jd--;
    }
    Md = Mp / Ms + 1;
    if(Mp % Ms == 0){
        Md--;
    }
    Hf = maxnum(Jd,Md);
    cout << vad - Hf << endl;
    return 0;
}

int maxnum(int x,int y){
    if(x < y){
        return y;
    }
    else if(x > y){
        return x;
    }
    return x;
}

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

int main()
{
	//Homework
	int num1,num2,num3,num4,num5,num6,num7,num8,num9;

	cin>>num1>>num2>>num3>>num4>>num5;
	num6=num2/num4;
	num7=num2%num4;
	if(num7>0){
		num6=num6+1;
	}
	num8=num3/num5;
	num9=num3%num5;
	if(num9>0){
		num8=num8+1;
	}
	if(num6<num8){
		num6=0;
		num6=num8;
	}
	num9=num1-num6;
	cout<<num9;
	cout<<"\n";
	return 0;
}

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
	int a,b,c,d,e;
	scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
	printf("%d\n",a-max((b+d-1)/d-(c+e-1)/e));
}

C++: #include<iostream>
#include<cmath>
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;
  return 0;
}

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

using namespace std;

int main()
{
	int n, math, jap, p, q,a=0,b=0,c=0;
	cin >> n >> jap >> math >> p >> q;
	
	if (jap % p != 0) {
		a = jap / p + 1;
	}
	else {
		a = jap / p;
	}
	if (math%q != 0) {
		b = math / q + 1;
	}
	else {
		b = math / q;
	}
	c=max(a, b);

	cout << n - c << endl;
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c,d,e,f,g,h,i,j,k;
	float A;
	cin>>a>>b>>c>>d>>e;
	A=b-d;
	f++;
	f=0;
	for (;;)
	{
		A=A-d;
		if(A>0)
		{
			f++;
		}
		else if (A<=0)
		{
			f++;
			break;
		}
	}
	A=c-e;
	g++;
	g=0;
	for (;;)
	{
		A=A-e;
		if (A>0)
		{
			g++;
		}
		else if (A<=0)
		{
			g++;
			break;
		}
	}
	if (f<=g)
	{
		cout<<g<<endl;
	}
	else if(f>=g)
	{ 
		cout<<f<<endl;
	}
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;

signed main() {
	int l, a, b, c, d; cin >> l >> a >> b >> c >> d;
	cout << l - max((a + c - 1 / c), (b + d - 1 / d)) << endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int L,a,b,c,d;
    cin>>L>>a>>b>>c>>d;
    while(1){
        L--;
        a-=c;
        b-=d;
        if(a<=0 && b<=0){
            cout<<L<<endl;
            break;
        }

    }
    return 0;
}

C++: #include<iostream>
main(){float L,A,B,C,D;std::cin>>L>>A>>B>>C>>D;std::cout<<(int)(L-std::max(A/C,B/D))<<"\n";}

C++: #include<stdio.h>
int main(void)
{
	int a,s,d,f,g,h,z,x;
	scanf("%d",&a);
	scanf("%d",&s);
	scanf("%d",&d);
	scanf("%d",&f);
	scanf("%d",&g);
	h=s/f;
	if(s%f!=0){
		h++;
	}
	z=d/g;
	if(d%g!=0){
		z++;
	}
	if(h>=z){
		printf("%d\n",a-h);
	}
	else if(z>h){
		printf("%d\n",a-z);
	}
	return 0;
}

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

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n, a, b, c, d,day,day2,ans;
	cin >> n >> a >> b >> c >> d;
	day = a / c;
	if (a%c != 0) {
		day = day + 1;
	}
	day2 = b / d;
	if (b%d != 0) {
		day2 = day2 + 1;
	}
	ans = n - max(day, day2);
	cout << ans << endl;
}

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){
	y = m/m1 + 1;
}
        else{
	y = m/m1;
}

int z;
	if(x>=y){
	z = x;
	}

	if(y>x){
	z = y;
	}

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