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 <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<28;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-10;
const ll mod=1e9+7;
const vi emp;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,-0};
const int DX[8]={-1,-1,-1,0,0,1,1,1},DY[8]={1,0,-1,1,-1,1,0,-1};

int a,b,c,d,e;

int main(){
	cin>>a>>b>>c>>d>>e;
	int m=max((b+d-1)/d,(c+e-1)/e);
	cout<<a-m<<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 main(void){
    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;
    
    else z=y;
    
    cout<<h-z<<endl;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n;
	cin >> n;
	int maxa, maxb;
	cin >> maxa >> maxb;
	int a, b;
	cin >> a >> b;
	int maxt = 0;
	if (maxa%a != 0) maxt = maxa / a + 1;
	else maxt = maxa / a;
	if (maxb%b != 0) maxt = max(maxt, maxb / b + 1);
	else maxt = max(maxt, maxb / b);
	cout << n - maxt << endl;
	return 0;
}

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

int main(){
  int l, A, B, a, b;

  while(cin >> l >> A >> B >> a >> b){
    int usedA = (A - 1) / a + 1;
    int usedB = (B - 1) / b + 1;

    cout << l - max(usedA, usedB) << endl;
  }
}

C++: #include <stdio.h>
#include <math.h>
int main(){
  int a, b, c, d, l, z ;
  int e, f;
  scanf("%d %d %d %d %d", &l, &a, &b, &c, &d);
  e = ceil((double)a/(double)c);
  f = ceil((double)b/(double)d);
  if(e>=f){
   z = l-e;
  }else{
     z =l-f;
  }
  printf("%d\n", z);
  return 0;
}

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

int main() {
	int l, a, b, c, d; cin >> l >> a >> b >> c >> d;
	while (a > 0 || b > 0) { a = a - c; b = b - d; l--; }
	cout << l << endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int l,a,b,c,d;
  cin >> l >> a >> b >> c >> d;
  int o=1;
  int x,y;
  x=a/c;
  if(a%c!=0) x++;
  y=b/d;
  if(b%d!=0) y++;
  cout << max(o,min(l-x,l-y)) << endl;
  
  return 0;
}

C++: #include <bits/stdc++.h>
#define fo(i,a) for(i = 0;i < a;i++)
using namespace std;
int cnt(int a,int c);
int main(void)
{
	int l,a,b,c,d,i=0,jp=0,mt=0,p=0;
	
	cin >> l >> a >> b >> c >> d ;
	jp = cnt(a,c) ;
	mt = cnt(b,d) ;
	i = max(jp,mt) ;
	p = l - i ;
	cout << p << endl ;
	
	return 0 ;
}

int cnt(int a,int c){
	int x=0;
	
	x = a / c ;
	if(a % c != 0){
		x ++ ;
	}
	
	return x ;
}

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

	int l,a,b,c,d,k,j;
	cin>>l>>a>>b>>c>>d;

	k=a/c;
	if(a%c>0){k=k+1;}
	j=b/d;
	if(b%d>0){j=j+1;}

	if(k==j){cout<<l-k<<endl;}
	else if(k>j){cout<<l-k<<endl;}
	else{cout<<l-j<<endl;}

	return 0;
	}

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

int main(){
	/*
	int a,b,c,d,e;

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

	int x;

	if(a > 0){
		x = e*(b-a);
	}
	if(a == 0){
		x = e*b + d;
	}
	if(a < 0){
		x = -c*a + e*b + d;
	}

	cout << x <<endl;
	*/

	/*
	int a,b,c,d,e,f;
	cin >> a >> b >> c >> d >> e >> f;
	int m,n;
	int x = a + b + c + d + e + f;


	
	if(e<f)
	{
		x = x - e;
		if(a<b)
		{
			if(a<c)
			{
				if(a<d)
				{
					cout << x-a << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
		else
		{
			if(b<c)
			{
				if(b<d)
				{
					cout << x-b << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
	}
	else
	{
		x = x - f;
		if(a<b)
		{
			if(a<c)
			{
				if(a<d)
				{
					cout << x-a << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
		else
		{
			if(b<c)
			{
				if(b<d)
				{
					cout << x-b << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
			else
			{
					if(c<d)
				{
					cout << x-c << endl;
				}
				else
				{
					cout << x-d << endl;
				}
			}
		}
	}
	*/
/*
	int n;
	cin >> n;
	int a;
	cin >> a;
	int max = a,min = a;
	int i = 1;
	while(i<n){
		cin >> a;
		if(a > max){
			max = a;
		}
		if(a < min){
			min = a;
		}
		i++;
	}
	cout << max << endl << min << endl;
	*/
	/*
	string s;
	cin >> s;
	int j,o,i;
	for(int i;i < s.size;i++){
		
	}
	*/
	/*
	int n;
	cin >> n;
	int A;
	int X[100000];
	int n=0;
	for(int i=0;i<n;i++){
		cin >> A;
		
	}
	*/
	/*
	int a,b,c,d,p;
	cin >> a >> b >> c >> d >> p;
	int X,Y=b;

	X = a*p;
	
	if(p>c){
		Y += d*(p-c);
	}

	if(X > Y){
		cout << Y << endl;
	}
	else{
		cout << X << endl;
	}
	*/ 

	int l,a,b,c,d;
	cin >> l >> a >> b >> c >> d;

		int Jap = a/c;
		if(a%c != 0){
			Jap += 1;
		}
		int Math = b/d;
		if(b%d != 0){
			Math += 1;
		}

	int day;
	if(Jap < Math) {
		day = Math;
	}

	cout << l - day << endl;

	return 0;
}

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

#define int long long int
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define sf(a) scanfs("%d",&a)
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()

using namespace std;

const int INF = 1e18 + 9;
const int Mod = 1e9 + 7;
inline int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;}
inline string numstr(int m){str s="";while(m>0){char c;int a=m/10;if(a>0)a=m%(a*10);else a=m;c=(char)('0'+a);s+=c;m/=10;}str st="";for(int i=s.size()-1;i>=0;i--){st+=s[i];}return st;}
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<pii> vii;

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,a,a1,b,b1;
    cin >> n >> a >> b >> a1>> b1;
    int aa=a/a1;
    if(a%a1!=0)aa++;
    int bb=b/b1;
    if(b%b1!=0)bb++;
    n-=max(aa,bb);
    cout << n << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;
int ans(){
int l,a,b,c,d;
cin>>l>>a>>b>>c>>d;
int i=0;
while(a>c*i or b>d*i){i++;}
return l-i;
}
int main() {
cout<<ans()<<endl;
	return 0;
}

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

int main(){
    int L,A,B,C,D,ans;
    cin>>L>>A>>B>>C>>D;
    ans=L;
    while(A>0 || B>0){
        ans--;
        A-=C; B-=D;
    }
    printf("%d\n",ans);
    return 0;
}