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<cstdio>
#include <algorithm>
#include <functional>
#include <vector>

using namespace std;

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

	int a,b,c,d,day;

	cin >> day >> a >> b >> c >> d;

	while(1){
		a -= c;
		b -= d;
		day--;
		if(a <= 0 && b <= 0) break;
	}

	printf("%d\n", day);

	return 0;
}

C++: #include <stdio.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 =double ceil( a/c);
  f =double ceil(b/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,x,y;
 cin >>l>>a>>b>>c>>d;
 if(a%c>0){
     x=a/c+1;}
 else{
      x=a/c;}
 if(b%d>0){
     y=b/d+1;}
 else{
      y=b/d;}
 if(x>y)
    cout<<l-x<<'\n';
 else
    cout<<l-y<<'\n';
 return 0;
}

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 - daysl;


  return 0;
}

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

C++: #include <cstdio>
int main(void){
int a,d,g,j,m;
scanf("%d%d%d%d%d",&a,&d,&g,&j,&m);
d=(d+j-1)/j;
g=(g+m-1)/m;
if(d<g)d=g;
printf("%d\n",a-d);
return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int A, B, C, D, L;

int main(){
  scanf("%d%d%d%d%d", &L, &A, &B, &C, &D);
  printf("%d\n", L - max(A/C + ((A%C)?1:0), B/D + ((B%D)?1:0)));
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int i,j,ans,L,A,B,C,D;
  cin >> L >> A >> B >> C >> D;
  for(i=0;A>0;i++){
    A-=C;
  }
  for(j=0;B>0;j++){
    B-=D;
  }
  if(i>j){
    ans=L-i;
  }
  else{
    ans=L-j;
  }
  cout << ans << 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<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<cstring>
#include<set>
#include<map>
#include<vector>
#include<cmath>
#include<queue>
#include<cstdio>
#include<cstdlib>
#define reep(n1,n2,n3) for(int n1=n3;n1<n2;n1++)
#define rep(n1,n2) reep(n1,n2,0)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define INF 1e9
using namespace std;
typedef long long int lint;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int,int> > vp;
typedef pair<int,int> pi;
typedef pair<int,pair<int,int> > pii;
typedef vector<string> vs;
const double PI  = acos(-1.0);
int main(){
    int a,b,c,d,l;
    cin>>l>>a>>b>>c>>d;
    cout<<l-max((a+c)/c,(b+d)/d)<<endl;
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int a,b,c,d,L;
    scanf("%d%d%d%d%d",&L,&a,&b,&c,&d);
    int ans=max(a/c+(a%c?1:0),b/d+(b%d?1:0));
    printf("%d\n",L-ans);
    return 0;
}

C++: #include <bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef long long ll;
const ll INF = 114514810;
const ll MOD = 1000000007;
const double EPS = 1e-8;
const double PI = acos(-1.0);
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
int dx[] = { -1, 0, 0, 1 }; int dy[] = { 0, -1, 1, 0 };
bool valid(int x, int y, int h, int w) { return (x >= 0 && y >= 0 && x < h&&y < w); }
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///



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

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

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

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

using namespace std;

int main()
{
    int wday, jpage, mpage, limjpage, limmpage;
    cin >> wday >> jpage >> mpage >> limjpage >> limmpage;

    int const jday = jpage / limjpage + ( jpage % limjpage != 0 ? 1 : 0 );
    int const mday = mpage / limmpage + ( mpage % limmpage != 0 ? 1 : 0 );

    int const total = max( jday, mday );

    cout << wday - total << endl;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c,d,l;
	int jp,ma,sum,abc,sa;
	bool bo=false;
	cin>>l>>a>>b>>c>>d;
	if(a%c!=0){
		jp=a/c;
		jp++;
	}
	else{
		jp=a/c;
	}
	if(b%d!=0){
	ma=b/d;
	ma++;
	}
	else {
		ma=b/d;
	}
	sum=jp+ma;
	sa=jp-ma;
	if(sa<0){
		sa*=-1;
		bo=false;
	}
	else{
		bo=true;
	}
	if(bo==false){
	cout<<l-ma<<endl;
	}
	else{
		cout<<l-jp<<endl;
	}
	return 0;
}

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

using namespace std;

int main(){

  int A,B,C,D,L;

  int a,b;
  int day;

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

  a=(A+C-1)/C;
  b=(B+D-1)/D;

  if(a>b){
    day=a;
  }
  else{
    day=b;
  }

  cout << L-day << endl;
 
  
  return 0;
}

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

using namespace std;

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

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

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

	scanf("%d", &L);
	scanf("%d", &A);
	scanf("%d", &B);
	scanf("%d", &C);
	scanf("%d", &D);

	jap = 0;
	while (A > 0) {
		A -= C;
		jap++;
	}
	mat = 0;
	while (B > 0) {
		B -= D;
		mat++;
	}
	L -= max(jap, mat);

	printf("%d\n", L);

	return 0;
}

C++: #include "iostream"
using namespace std;

int main(void)
{
	int vac, jpn, math, jpn_d, math_d;
	cin >> vac >> jpn >> math >> jpn_d >> math_d;

	int jpnDay, mathDay;
	if ((jpn%jpn_d) == 0) {
		jpnDay = jpn / jpn_d;
	}else {
		jpnDay = jpn / jpn_d + 1;
	}
	if ((math%math_d) == 0) {
		mathDay = math / math_d;
	}else {
		mathDay = math / math_d + 1;
	}

	if (jpnDay > mathDay) {
		cout << vac - jpnDay << endl;
	}else {
		cout << vac - mathDay << endl;
	}
	return 0;
}