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){
    // Your code here!
    int L,A,B,C,D,AC,BD;
    cin>>L>>A>>B>>C>>D;
    if(A%C==0)AC=L-(A/C);
    else AC=L-(A/C+1);
    if(B%D==0)BD=L-(B/D);
    else BD=L-(B/D+1);
    cout<<AC<<' '<<BD<<endl;
    if(AC<BD)cout<<AC<<endl;
    else cout<<BD<<endl;
}

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

C++: #include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>

using namespace std;


int main(){

	int L,A,B,C,D,day_kokugo,day_sansu;

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

	day_kokugo = A/C;
	if(A%C > 0)day_kokugo++;

	day_sansu = B/D;
	if(B%D > 0)day_sansu++;

	printf("%d\n",L-max(day_kokugo,day_sansu));

	return 0;
}

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

int main(){
	int day, a[4], ans=-1;

	scanf(" %d", &day);
	for(int i=0; i<4; ++i) scanf(" %d", &a[i]);
	
	for(int i=0; i<2; ++i){
		int p=a[i]/a[i+2];
		if(a[i]%a[i+2]==0){
			if(ans<p) ans=p;
		}
		else {
			if(ans<p) ans=p+1;
		}
		//printf("%d\n", ans);
	}
	printf("%d\n", day-ans);

	return 0;
}

C++: #include <stdio.h>

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

	printf("%f\n",&z);
	return 0;
}

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

using namespace std;

int main()
{
	int l;
	int j_max, m_max, j_page, m_page;
	int i;
	
	cin >> l >> j_page >> m_page >> j_max >> m_max;

	
	for(i = 0; ; i++){
		j_page -= j_max;
		m_page -= m_max;
		
	//	cout << j_page << " " << m_page << endl;
		
		if(j_page <= 0 && m_page <= 0){
			i++;
			break;
		}
	}
	cout << l-i << 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-1)/C+1;
	int F = (B-1)/D+1;

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

	return 0;
}

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

using namespace std;

int main() {

	int n[5];

	for (int i = 0; i < 5; i++) {
		scanf("%d", &n[i]);
	}

	printf("%d\n", n[0] - max((int)ceil((double)n[1] / n[3]), (int)ceil((double)n[2] / n[4])));

	return 0;
}

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

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

a=A/C;
b=B/D;

if(A%C>0)
a++;
if(B%D>0)
b++;

if(a>b)
cout<<L-a<<'\n';
else
cout<<L-b<<'\n';

return 0;
}

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

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

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

C++: #include<stdio.h>
int main(void)
{
	int n,m,a,s,d,x=0,w,p=0,h=0;
	scanf("%d %d %d %d %d",&n,&m,&a,&s,&d);
	w=1;
	x=s;
	h=d;
	while(1){
		if(m<=s&&a<=d) break;
		s+=x;
		d+=h;
		w++;
		
	}
	n=n-w;
	printf("%d\n",n);
}

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;
		else
			x=A/C+1;
	if(B%D==0)
		y=B/D;
		else
			y=B/D+1;
	if(x<y)
		x=y;
		
	cout << L-x <<endl;

	return 0;
}

C++: #include<iostream>
using namespace std;
      
int main()
{
int L,A,B,C,D,K,E,F;
cin>>L>>A>>B>>C>>D;
E=A/C;
F=B/D;
if(A%C>0){
E+=1;
}
if(B%D>0){
F+=1;
}
if(E<F){
K=L-E;
}
else
K=L-F;
cout<<K<<'\n';
return 0;
}

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

int main()
{
	int l, a, b, c, d;
	cin >> l >> a >> b >> c >> d;

	while(a > 0 || b > 0){
		if(a > 0)
			a -= c;
		if(b > 0)
			b -= d;
		l--;
	}

	cout << l << endl;

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
int vac,jap,math,jap_cap,math_cap,jpc,mtc;
cin>>vac>>jap>>math>>jap_cap>>math_cap;
jpc=jap/jap_cap;
mtc=math/math_cap;
if(jap%jap_cap!=0)jpc++;
if(math%math_cap!=0)mtc++;
if(jpc>=mtc)cout<<vac-jpc<<endl;else cout<<vac-mtc<<endl;
return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <cstring>
#include <queue>
int spotx[1001] = { 0 };
int spoty[1001] = { 0 };
using namespace std;
int main() {
	int a, b, c, d, e;
	scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
	int hoge = b / d;
	int hogehoge = c / e;
	if (b%d != 0) {
		hoge++;
	}
	if (c%e != 0) {
		hogehoge++;
	}
	printf("%d\n", a - max(hoge, hogehoge));
	return 0;
}

C++: #include<cstdio>
int main(){
    int n,ja,ma,japd,mapd,jad,mad,bigd;
    scanf("%d%d%d%d%d",&n,&ja,&ma,&japd,&mapd);
    jad=ja/japd+1;
    if(ja%japd==0)
        jad--;
    mad=ma/mapd+1;
    if(ma%mapd==0)
        mad--;
    if(jad<mad)
        bigd=mad;
    else
        bigd=jad;
    printf("%d\n",n-bigd);
    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>
using namespace std;
main(){
  int l, a, b, c, d;
  cin >> l >> a >> b >> c >> d;
  cout << l - max(a/c+(a%c?1:0), b/d+(b%d?1:0)) << endl;
}

C++: #include<stdio.h>
int main(void)
{
	int n,a,b,c,d;
	int s,ss;
	scanf("%d",&n);
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);

	s=a/c;
	//printf("s=%d\n",s);
	if(a%c!=0){
	s=s+1;
	//printf("s1=%d\n",s);
	}
	ss=b/d;
	//printf("ss=%d\n",ss);
	if(b%s!=0){
		ss=ss+1;
	//	printf("ss=%d\n",ss);
	}
	
	if(s>=ss){
		n=n-s;
		printf("%d\n",n);
	}
	else if(ss>s){
		n=n-ss;
		printf("%d\n",n);
	}
	
	return 0;
}

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

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

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) << "\n";
    return 0;
}