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 <cstdio>
using namespace std;
int main(void){
  int i=0,a,b,c,d;
  int day;

  scanf("%d %d %d %d %d",&day,&a,&b,&c,&d);
  while(a>0||b>0){
    a-=c;
    b-=d;
    i++;
  }
  printf("%d\n",day-i);
  return 0;
}

C++: #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int tino,tiya,kokoa,rize,syaro;
    cin>>tino>>tiya>>kokoa>>rize>>syaro;
    int gotiusa=0;
    int aoayama=0;
    for(;tiya>=0;gotiusa++)tiya-=rize;
    for(;kokoa>=0;aoayama++)kokoa-=syaro;
    cout<<tino-max(aoayama,gotiusa)<<endl;
}

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

C++: // 2014/11/12 Tazoe

#include <iostream>
using namespace std;

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

	int E = A/C;
	if(A%C!=0){
		E++;
	}

	int F = B/D;
	if(B%D!=0){
		F++;
	}

	if(E>F){
		cout << L-E << endl;
	}
	else{
		cout << L-F << endl;
	}

	return 0;
}

C++: // 2013/05/13 Tazoe

#include <iostream>
using namespace std;

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

	int E = A/C;
	if(A%C!=0){
		E++;
	}

	int F = B/D;
	if(B%D!=0){
		F++;
	}

	if(E>F){
		cout << L-E << '\n';
	}
	else{
		cout << L-F << '\n';
	}

	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-=c;
    b-=d;
    l--;
  }
  cout<<l<<endl;
  return 0;
}

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

using namespace std;

/*-------------------------------*/
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b) - 1; i >= (a); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define rep(i, n) for(int i = 0; i < (n); i++)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define all(i) (i).begin(),(i).end()
#define pb push_back
#define mp make_pair

typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef vector<long long> llv;
typedef vector<pint> vpint;

/*-------------------------------*/

int main(void)
{
  int i[5];
  int x, y;
  rep(a, 5) cin >> i[a];

  x = i[1] % i[3] != 0 ? i[1] / i[3] + 1 : i[1] / i[3];
  y = i[2] % i[4] != 0 ? i[2] / i[4] + 1 : i[2] / i[4];
  x = max(x, y);

  cout << i[0] - x << endl;

  return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int l,a,b,c,d,n,m,x,y,ans;
	scanf("%d %d %d %d %d",&l,&a,&b,&c,&d);
	n=a/c;
	x=a%c;
	m=b/d;
	y=b%d;
	if(x>=1){
		n=n+1;
	}
	if(y>=1){
		m=m+1;
	}
	if(n<=m){
		ans=l-m;
	}
	else if(m<=n){
		ans=l-n;
	}
	printf("%d\n",ans);
}

C++: #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ---------------------------------------------------------------------------

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a,b,c,d,n;
    cin >> n >> a >> b >> c >> d;
    cout << n - max((a+c-1)/c,(b+d-1)/d) << enld;
    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){
		hi++;
		}
	if(tuki<ftuki){
		tuki++;
		}
	if(hi>tuki){
		cout << L-hi <<'\n';
	}else{
		cout << L-tuki <<'\n';
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){

  int A, B, C, D, L;
  int date_langue, date_math, date_play;
  int tmp;
  
  while(1){
    cin >> L >> A >> B >> C >> D;
    
    date_langue = A/C;

    tmp = A%C;
    if(tmp > 0)
      date_langue ++;

    date_math = B/D;
    tmp = B%D;
    if(tmp > 0)
      date_math ++;
 
    if(date_langue > date_math){
      date_play = L - date_langue;
    }else date_play = L - date_math;
    
    cout << date_play << endl;
  }
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<cctype>
#include<string.h>
#include <stdlib.h>

#define PI 3.1415926
void swap(int* x, int* y) {
	int a = *x;
	int b = *y;
	*x = b;
	*y = a;
}
int factorial(int n);
int sum(int n, int*);
int ave(int n, int*);
int min(int n, int*), min(int n, int m);
int max(int n, int*), max(int n, int m);

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-A%C)/ C, (B-B%D) / D)-1);
	return 0;
}

int factorial(int n) {
	if (n > 0) {
		return n * factorial(n - 1);
	}
	else {
		return 1;
	}
}
int sum(int n, int *all) {
	int total = 0;
	for (int i = 0; i < n; ++i) {
		total += all[i];
	}
	return total;
}
int ave(int n, int *all) {
	int total = 0;
	for (int i = 0; i<n; ++i) {
		total += all[i];
	}
	return total / n;
}
int min(int n, int *all) {

	int min = all[0];
	for (int i = 1; i < n; ++i) {
		if (all[0] > all[i]) {
			min = all[i];
		}
	}
	return min;
}
int max(int n, int *all) {
	int max = all[0];
	for (int i = 1; i<n; ++i) {
		if (all[0]<all[i]) {
			max = all[i];
		}
	}
	return max;
}
int max(int n, int m) {
	if (n >= m) {
		return n;
	}
	else {
		return m;
	}
}
int min(int n, int m) {
	if (n >= m) {
		return m;
	}
	else {
		return n;
	}
}

C++: #include<stdio.h>
int main()
{
int L=0,A,B,C,D,E=0,K=0,J=0;
scanf("%d\%d\n%d\n%d\n%d",&L,&A,&B,&C,&D);
if(A%C==0){
K=A/C;
}else{
A=A/C;
K=A+1;
}
if(B%D==0){
J=B/D;
}else{
B=B/D;
J=B+1;
}
if(K>J){
L=L-K;
}else if(J>K||K==J){
L=L-J;
}
printf("%d\n",L);
return(0);
}