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<algorithm>
using namespace std;
int main(){
	int p,a,b,c,d,x,y;
	cin>>p;
	cin>>a;
	cin>>b;
	cin>>c;
	cin>>d;
	x=a/c;
	if(a%c)
	x++;
	y=b/d;
	if(b&d)
	y++;
	cout<<p-max(x,y)<<endl;
return 0;
}

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

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

C++: #include <iostream>
#include <algorithm>
#include <array>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(int i = (a); i < (b); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define vvint vector<vector<int>>
#define vsort(x) sort(x.begin(),x.end())

using int64 = uint64_t;

using namespace std;

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

C++: #include<iostream>
using namespace std;
int L, A, B, C, D;
int rA = 0, rB = 0;
int main(){
cin >> L >> A >> B >> C >> D;
if( a - (A/C) * C > 0) { rA = 1;}
if( B - (B/D) * D > 0) { rB = 1;}
cout << L - max((A/C) + rA,(B/D) +rB ) << endl;
return0;
}

C++: #include <stdio.h>
int main(){
  int l,a,b,c,d,p,i;
  scanf("%d %d %d %d %d",&l,&a,&b,&c,&d);
  for(i = 1 ; a > c || b > d ; i++){
    a = a-c;
    b = b-d;
  }
  p = l - i;
  printf("%d\n",p);
  return 0;
}

C++: #include <cstdio>
#include <algorithm>
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", min(l - --a/c - 1, l - --b/d - 1));
    return 0;
}

C++: #include <iostream>
#include <algorithm>
int main() {
	int l; // ??¬???????????\??°
	int a, b, c, d;
	int koku, san;
	std::cin  >> l >> a >> b >> c >> d;
	koku = b / d;
	san = a / c;

	l = l - std::max(koku, san);
	
	std::cout << l << std::endl;

	return 0
}

C++: #include <iostream>
 
using namespace std;
 
int main()
{
    int L, A, B, C, D;
    cin >> L >> A >> B >> C >> D;
    const int a = (A / C) + ((A % C) != 0);
    const int b = (B / D) + ((B % D) != 0);
    cout<<L-max(a,b)<<"\n";
    return 0;
}

C++: #include<stdio.h>
int main()
{
	int a[101], temp = 0, ruio = 0, ahotoy=0;
	for (int i = 1; i <= 5; i++) {
		scanf("%d", &a[i]);
	}
	while (a[2] > 0 && a[3] > 0) {
		if (a[2] > 0) {
			a[2] = a[2] - a[4];
			ruio++;
		}
		else {
			a[3] = a[3] - a[5];
			ruio++;
		}
	}
	printf("%d\n", a[1]-ruio);
}

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

int main(){
  int l;
  int a,b;
  int c,d;
  int ans;
  int j,m;

  scanf(" %d %d %d %d %d",&l,&a,&b,&c,&d);

  j = m = 0;
  if(a%c!=0){
    j=1;
  }
  if(b%d!=0){
    m=1;
  }

  ans = max(a/b+j,b/d+m);

  printf("%d\n",l-ans);

  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int L,A,B,C,D;
int main(){
  cin>>L>>A>>B>>C>>D;
  cout<<L-max(A/C+(A%C>0),B/D+(B%D>0))<<endl;;
  return 0;
}

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

int main(){
	int l;
	int a,b,c,d;
	cin>>l>>a>>b>>c>>d;
	int e=(c+a-1)/c;
	int f=(b+d-1)/d;
	
	if(e<f||f==e)
	cout<<l-f<<endl;
	else if(f<e)
	cout<<l-e<<endl;
	
	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 <iostream>
#include<cstdio>

using namespace std;

int main(){
	int l(2 <= 40), a(2 <= 1000), b(2 <= 1000), c(2 <= 1000), d(2 <= 1000), v,t;
	cin >> l >> a >> b >> c >> d;
	v  = a+b;
	for (int i; i = 0; i++){
		v - c+d;
		t++;
		if (v < a + b){ break; }
	}
	cout << t + 1 << endl;

		return 0;
}

C++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;
  
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};

int main(){
  int total_holidays;
  while(~scanf("%d",&total_holidays)){
    int japanese_drill_pages;
    int math_drill_pages;
    int max_japanese_pages_par_day;
    int max_math_pages_par_day;
    scanf("%d %d %d %d",
	  &japanese_drill_pages,
	  &math_drill_pages,
	  &max_japanese_pages_par_day,
	  &max_math_pages_par_day);

    int remaining_days =
      total_holidays
      - max(japanese_drill_pages / max_japanese_pages_par_day
	    + (bool)(japanese_drill_pages % max_japanese_pages_par_day),
	    math_drill_pages / max_math_pages_par_day
	    + (bool)(math_drill_pages % max_math_pages_par_day));
	    
    printf("%d\n",remaining_days);
  }
}

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

int max(int x,int y){if(x>=y)return x; return y;}

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-1)/c,(b-1)/d)-1);
}

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

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
using namespace std;
int main()
{
	int a, b, c, d, e, i, j, k, l, m, n, o, p, q, r;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	cin >> e;
	j = d%b;
	if (j>0)
	{
		b = b / d;
		b = b + 1;
	}
	else if (j == 0)
	{
		b = d / b;
	}
	i = e%c;
	if (i>0)
	{
		c = c / e;
		c = c + 1;
	}
	else if (i == 0)
	{
		c = e / c;
	}
	a=a-max(b, c);
	cout <<a<< endl;
	return 0;
}

C++: #include<iostream>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int L,A,B,C,D;//L:winter vacation A:Japanese homework B:math homework
	cin>>L>>A>>B>>C>>D;
	double spentA=(double)A/C;
	double spentB=(double)B/D;
	int wasteA=(int)spentA;
	int wasteB=(int)spentB;
	int ansA,ansB;
	if(spentA==wasteA)ansA=wasteA;
	else ansA=wasteA+1;
	if(spentB==wasteB)ansB=wasteB;
	else ansB=wasteB+1;
	cout<<ansA<<" "<<ansB<<endl;
	cout<<L-max(ansA,ansB)<<endl;
	return 0;
}

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

using namespace std;


int main(void){

	int L, A, B, C, D;

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

	cout << L - max(A / C + (A%C != 0), B / D + (B%D != 0)) << endl;
	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;
  }
  if(ka>ki){
  cout<<a-ka<<endl;
  }else{
    cout<<a-ki<<endl;
  }
}