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()
{
  int day,J,M,Jday,Mday,asobuz;

  cin >> day;
  cin >> J;
  cin >> M;
  cin >> Jday;
  cin >> Mday;

  int a = 0;
  while(J > 0){
    J -= Jday;

    a++;
  }

  int b = 0;
  while(M > 0){
    M -= Mday;
    b++;
  }
 
  if(a > b){
    asobuz = a;
  }
  else{ 
    asobuz = b;  
  }

  day -= asobuz; 
  cout << day << endl;

}

C++: #include <stdio.h>
int main(){
  int a, b, c, d, l, z ;
  double e, f;
  scanf("%d %d %d %d %d", &l, &a, &b, &c, &d);
  e = a/c;
  double ceil(double e);
  f = b/d;
  double ceil(double f);
  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;
	int koku, suu;
	koku = A / C;
	if(A % C != 0)
		koku++;
	
	suu = B / D;
	if(B % D != 0)
		suu++;
	cout << (L - ((koku > suu) ? koku : suu)) << endl;
	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>
using namespace std;

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

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

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 += 1;
	w = c / e;
	if (c%e == 1) w += 1;
	cout << a - max({q,w });
}

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

int main(){
  int l, a, b, c, d, e, f, m;

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

  e=a/c; m=a%c;
  if (m!=0) e++;

  f=b/d; m=b%d;
  if (m!=0) f++;

  if(e>f){
    cout << l-e << endl;
  } else {
    cout << l-f << endl;
  }

  return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int vac, jap[2], math[2], hw;

	cin >> vac >> jap[0] >> math[0] >> jap[1] >> math[1];

	hw = 1;
	while (1){
		if ((jap[0] - jap[1]) > 0 || (math[0] - math[1]) > 0){
			jap[0] -= jap[1];
			math[0] -= math[1];
			hw++;
		}
		else {
			break;
		}
	}

	cout << vac - hw << endl;

	return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

//int N,M,K,L,R,H,W;
long long int N,M,K,L,R,H,W;

//constexpr long long int MOD=1000000007;
//constexpr  int MOD=1000000007;
constexpr int MOD=998244353;
//constexpr long long int MOD=998244353;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	cin>>N>>L>>R>>H>>W;
	cout<<N-max((L+H-1)/H,(R+W-1)/W)<<endl;
	
	return 0;
}

C++: #include <cstdio>
#define max(a,b) (a > b ? a : b)
int main(){
	int a[5];
	for(int i = 0; i < 5; i++){
		scanf("%d",&a[i]);
	}
	int ans = a[0] - max(a[1]/a[3] + (a[1] % a[3] == 0 ? 0 : 1),a[2]/a[4] + (a[2] % a[4] == 0 ? 0: 1));
	printf("%d\n",ans);
	return 0;
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int main()
{
    int n,a,b,al,bl;
    int cnt=0,nn;
    cin>>n;
    cin>>a>>b;
    cin>>al>>bl;
    for(;;)
    {
        a-=al;
        b-=bl;
        cnt++;
        if(a<=0&&b<=0)break;
    }
    nn=n-cnt;
    cout<<nn<<endl;
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int d,w[2],p[2],dw[2];
  cin >>d;
  for(int i=0; i<2; i++) cin >>w[i];
  for(int i=0; i<2; i++) cin >>p[i];
  for(int i=0; i<2; i++){
    int r = (w[i]%p[i])? 1:0;
    dw[i] = w[i]/p[i]+r;
  }
  cout <<d-max(dw[0],dw[1])<<endl;
}

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

	return 0;
}

C++: //============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
int A,B,C,D,L;
int main() {
	cin>>L>>A>>B>>C>>D;
	int E=0,F=0;
	E=A/C;
	if(A%C!=0)E+=1;
	F=B/D;
	if(B%D!=0)F+=1;
	if(E>F)cout<<L-E<<endl;
	if(E<F||E==F)cout<<L-F<<endl;

	return 0;
}

C++: #include <iostream>

void solve() {
    int l, a, b, c, d;
    std::cin >> l >> a >> b >> c >> d;
    std::cout << l - std::max((c + a - 1) / c, (b + d - 1) / d) << "\n";
}

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

    solve();

    return 0;
}

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

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

int main(){
    int day,a,b,c,d;
    cin >>day>>a>>b>>c>>d;
    a=a/c;
    if(a%c!=0)a++;
    cout <<a<<endl;
    b=b/d;
    if(b%d!=0)b++;
    cout <<b<<endl;
    if(a>b)day-=a;
    else day-=b;
    cout <<day<<endl;

    return 0;
}

C++: #include <iostream>

using namespace std;


int main(){
    int l,a,b,c,d;
    cin>>l>>a>>b>>c>>d;
    a=a%c?a/c+1:a/c;
    b=b%d?b/d+1:b/d;
    cout<<l-max(a,b)<<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 ans = L - max((A + C - 1) / C, (B + D - 1) / D);
    cout << ans << endl;
    return 0;
}

C++: #include <stdio.h>

int main(void){

int l,a,b,c,d;

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

if(a/c>b/d) printf("%d\n",l-a/c);
else  printf("%d\n",l-b/d);

return 0;

}

C++: #include <stdio.h>

int main(){
	int i,A,B,C,D,L,day,x,y,ja,ma;
	scanf("%d\n",&L);
	scanf("%d\n",&A);
	scanf("%d\n",&B);
	scanf("%d\n",&C);
	scanf("%d\n",&D);
	ja=A/C;
	ma=B/D;
	x=A%C;
	y=B%D;
	if(x=!0){
		ja=ja+1;
	}
	if(y=!0){
		ma=ma+1;
	}
	if(ja>ma){
		L=L-ja;
	}else{
		L=L-ma;
	}
	printf("%d\n",L);
	return 0;
}

C++: #include <stdio.h>

int main(void)
{
	int L, A, B, C, D;
	int i, j;
	
	 scanf("%d %d %d %d %d", &L, &A, &B, &C, &D);
	 
	 i = 0;
	 while (A > 0 && B > 0){
		A -= C;
		B -= D;
		i++;
	 }
	 if (A != 0 || B != 0){
	 	i++;
	 }
	 
	 L -= i;
	 
	 printf("%d\n", L);
	 
	 return (0);
}