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>
using namespace std;

int main(void) {
    int a[5];
    int t1,t2,ans;
    for(int i=0; i<5; i++)
        cin>>a[i];

    t1 = a[1]%a[3]; t2=a[2]%a[4];
    int p1 = a[1]/a[3], p2 = a[2]/a[4];
    if(t1 == 0 && t2 == 0)
        ans = a[0] - max(p1, p2);
    else if(t1 == 0)
        ans = a[0] - max(p1, p2+1);
    else if(t2 == 0)
        ans = a[0] - max(p1+1, p2);
    else
        ans = a[0] - max(p1+1, p2+1);

    cout << ans << endl;

    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <limits>
typedef long long ll;
#define REP(i,n)   for(int i=0; i<(int)(n); ++i)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); ++i)

#define in cin
#define out cout
#define pb push_back
using namespace std;

int main(){
	int a, b ,c,d,e;
	in >> a >> b >> c >> d >> e;
	int f, g;
	f = b / d;
	g = c / e;
	if (b%d)f++;
	if (c%e)g++;
	a -= max(f, g);

	
	out << a << endl;
	return 0;

}

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

int main() {
	int a, b, c, d, e, q, w;
	cin >> a >> b >> c >> d >> e;
	q = b / d;
	if (b%d == 1) q = q+1;
	w = c / e;
	if (c%e == 1) w = w+1;
	cout << a - max({ q,w }) << endl;
}

C++: #include<iostream>

int main(){
	int a, b, c, d, e,f,g;
	f = 0;
	g = 0;
	std::cin >> a >> b >> c >> d >> e;
	if (b%d == 0){
		f = b / d;
	}
	else {
		f = b / d + 1;
	}
	if (c%e == 0){
		g = c / e;
	}
	else {
		g = c / e + 1;
	}
	if (f >= g){
		std::cout << a - f << std::endl;
	}
	if (f < g){
		std::cout << a - g << std::endl;
	}
	return 0;
}

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

int main(void){
  ios::sync_with_stdio(false);
  cin.tie(0);

  int ans = 0;

  int L, A, B, C, D;
  cin >> L >> A >> B >> C >> D;

  ans = max(A/C + (A%C == 0 ? 0 : 1), B/D + (B%D == 0 ? 0 : 1));

  cout << L - ans << endl;

  return 0;
}

C++: #include<bits/stdc++.h>
#include<algorithm>
#include<vector>
#include<queue>
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 <cstdio>
#include <cmath>
#include <stack>

#define rep(i,x) for(int i=0;i<x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rep_to(a,i,x) for(int i=a;i<x;i++)

using namespace std;


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

	while(1)
	{
		if(A<=0 && B<=0)break;
		A-=C;
		B-=D;
		L--;
	}
	cout<<L<<endl;
	return 0;
}

C++: #include <stdio.h>

float main(void)
{
	float l,a,b,c,d,e,f,v,w,x,y,z;
	l,a,b,c,d,e,f,v,w,x,y,z=0;
	
	scanf("%f",&l);
	scanf("%f",&a);
	scanf("%f",&b);
	scanf("%f",&c);
	scanf("%f",&d);
	
	if(a%c=0){v=l-a/c};
	if(b%d=0){w=l-b/d};
	if(a%c!=0){x=l-1-a/c};
	if(b%d!=0){y=l-1-b/d};

    if(v<w){w=z};
    if(w<v){v=z};
    if(x<y){y=z};
    if(y<x){x=z};
	printf("%f\n",&z);
	return 0;
}

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

int main()
{
	//??????(homework)
	int num1=0,num2=0,num3=0,num4=0,num5=0,num6=0,num7=0,num8=0,num9=0,num10=0,t=0;
	cin>>num1>>num2>>num3>>num4>>num5;
	num6=num2/num4;
	num9=num2%num4;
	if(num9!=0){
		num6=num6+1;
	}
	num7=num3/num5;
	num10=num3%num5;
	if(num10!=0){
		num7=num7+1;
	}
	if(num6<num7){
		t=num6;
		num6=num10;
		num10=t;
	}
	num8=num1-num6;
	cout<<num8;
	cout<<"\n";
	return 0;
}

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

int main()
{
	//??????(homework)
	int num1=0,num2=0,num3=0,num4=0,num5=0,num6=0,num7=0,num8=0,num9=0,num10=0,t=0;
	cin>>num1>>num2>>num3>>num4>>num5;
	num6=num1/num3;
	num9=num1%num3;
	if(num9!=0){
		num6=num6+1;
	}
	num7=num2/num4;
	num10=num2%num4;
	if(num10!=0){
		num10=num10+1;
	}
	if(num6<num7){
		t=num6;
		num6=num7;
		num7=t;
	}
	num8=num1-num6;
	cout<<num8;
	cout<<"\n";
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>
#include <climits>
#include <deque>
#include <bitset>
#include <cassert>
#include <ctime>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
const int dy[]={-1,0,1,0},dx[]={0,1,0,-1};
// adjust problem by problem
const double EPS=1e-8;
const double PI=acos(-1.0);
#ifdef __GNUC__
int popcount(int n){return __builtin_popcount(n);}
int popcount(ll n){return __builtin_popcountll(n);}
#endif
#ifndef __GNUC__
template<class T> int popcount(T n){int cnt=0;while(n){if(n%2)cnt++;n/=2;}return cnt;}
#endif
template<class T>int SIZE(T a){return a.size();}
template<class T>string IntToString(T num){string res;stringstream ss;ss<<num;return ss.str();}
template<class T>T StringToInt(string str){T res=0;for(int i=0;i<SIZE(str);i++)res=(res*10+str[i]-'0');return res;}
template<class T>T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template<class T>T lcm(T a,T b){return a/gcd(a,b)*b;}
template<class T> void PrintSeq(T &a,int sz){for(int i=0;i<sz;i++){cout<<a[i];if(sz==i+1)cout<<endl;else cout<<' ';}}
bool EQ(double a,double b){return abs(a-b)<EPS;}
void fastStream(){cin.tie(0);std::ios_base::sync_with_stdio(0);}
vector<string> split(string str,char del){
  vector<string> res;
  for(int i=0,s=0;i<SIZE(str);i++){
    if(str[i]==del){if(i-s!=0)res.push_back(str.substr(s,i-s));s=i+1;}
    else if(i==SIZE(str)-1){res.push_back(str.substr(s));}
  }
  return res;
}

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

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

C++: #include <iostream>

using namespace std;

int main(void)
{
  int days;
  int kokugo_page;
  int math_page;
  int capa_kokugo;
  int capa_math;
  int max_days=0;
  int math_days;
  int kokugo_days;
  
  cin >> days;
  cin >> kokugo_page;
  cin >> math_page;
  cin >> capa_kokugo;
  cin >> capa_math;

  math_days=math_page/capa_math;
  if(math_page%capa_math!=0)
    math_days++;
  
  kokugo_days=kokugo_page/capa_kokugo;
  if(kokugo_page%capa_kokugo!=0)
    kokugo_days++;
  
  if(max_days<kokugo_days)
    max_days=kokugo_days;

  if(max_days<math_days)
    max_days=math_days;

  cout << days-max_days << endl;

  return 0;
}

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

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