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 <cstdlib>
using namespace std;

int main() {
  int l, a, b, c, d;
  cin >> l >> a >> b >> c >> d;
  cout << l - max( a / c + !!( a % c ), b / d + !! ( b % d ) ) << endl;

  return EXIT_SUCCESS;
}

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

int main(void){

  int l,a,b,c,d,res1,res2;

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

  res1 = a / c;
  res2 = b / d;

  if(a % c != 0) res1++;
  if(b % d != 0) res2++;

  l -= max(res1,res2);

  cout << l << 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;

  a=(a-1)/c+1;
  b=(b-1)/d+1;
  L-=max(a,b);
  cout <<L<<endl;  

  return 0;
}

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

int main(){
	int i,num[5];
	for(i = 0;i < 5;i++){
		scanf("%d",&num[i]);
	}
	printf("%d\n",num[0] - std::max((num[1] - 1) / num[3],(num[2] - 1) / num[4]) - 1);
	return 0;
}

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

int main(){
    int n, a, b, c, d;
    cin >> n >> a >> b >> c >> d;
    cout << max(n-max((a-1)/c+1,(b-1)/d+1),0) << endl;
    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", l - max((a + c - 1) / c, (b + d - 1) / d));

	return 0;
}

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

int main(){
	int a[5];
	for(int i=0;i<5;i++) scanf("%d",&a[i]);
	printf("%d\n",min(a[0],min(a[1],a[2]))+min(a[3],a[4])-50);
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
    double a[5];
    for(int i=0;i<5;i++){
        cin>>a[i];
    }
    double x=ceil(a[1]/a[3]);
    double y=ceil(a[2]/a[4]);
    
    if(x>y)cout<<a[0]-x<<endl;
    else cout<<a[0]-y<<endl;
    
}

C++: #include <iostream>

using namespace std;


int main(){

  int a,b,c,d,l,sum=0,e,f;

 cin >> l >> a >> b >> c >> d ;
 
while(1){

  if(a<c){
    f=1;
  }

  if(f==1){
    break;
  }
 c+=c;

 sum++;
 }

while(1){

  if(b<d){
    e=1;
  }

  if(e==1){
    break;
  }
 d+=d;

 sum++;
 }

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


 return 0;
}

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

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) << '\n';
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;
int main(){
	int l,a,b,c,d;
	int kokugo;
	int sansuu;
	scanf("%d",&l);
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);
	if(a%c==0){
		kokugo=a/c;
	}
	else{
		kokugo=(a/c)+1;
	}
	if(b%d==0){
		sansuu=b%d;
	}
	else{
		sansuu=(b/d)+1;
	}
    int sum=max(kokugo,sansuu);
    printf("%d\n",l-sum);
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(int argc, char *argv[])
{
  int l, a, b, c, d;
  cin >> l >> a >> b >> c >> d;
  int x = (a + c - 1) / c;
  int y = (b + d - 1) / d;
  int z = max(x, y);
  cout << max(l - z, 0) << endl;
  return 0;
}

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

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

int main(){
	int x,a,b,c,d;
	cin>>x>>a>>b>>c>>d;
	cout<<x-max((a+c-1)/c,(b+d-1)/d)<<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>
#include<algorithm>
int main() {
	int L, A, B, C, D;
	std::cin >> L >> A >> B >> C >> D;
	int m, j;
	j = A / C;
	if (A%C != 0) {
		j = j + 1;
	}
	m = B / D;
	if (B%D != 0) {
		m = m + 1;
	}
	std::cout << L - std::max(j, m) << std::endl;
	return 0;
}

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 <iostream>
#include <algorithm>

using namespace std;

int main() {
  int L, A, B, C, D;
  cin >> L >> A >> B >> C >> D;
  L -= max((A + C - 1) / C, (B + D - 1) / D);
  cout << L << endl;
  return 0;
}

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
	int a,b,c,d,e;
	scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
	printf("%d\n",a-max((b+d-1)/d,(c+e-1)/e));
}

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

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>

//#define PI 3.141592653589

using namespace std;



int main()
{
	int L, A, B, C, D;
	int kokugo, sansuu;
	
	cin >> L >> A >> B >> C >> D;
	kokugo = (A + (C-1)) / C;
	sansuu = (B + (D-1)) / D;
	
	if (kokugo > sansuu)
	{
		cout << L - kokugo << endl;
	} else {
		cout << L - sansuu << endl;
	}
	
	//cout << "kokugo = " << kokugo << endl;
	//cout << "sansuu = " << sansuu << 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) {
    L--;
    A -= C, B -= D;
  }
  cout << L << endl;
}

C++: #include<stdio.h>
int main(void)
{
	
	int i=20,j=0,k=0,l=25,m=6,o=30,n=8;
	do{
    
	l-=m;
	j++;
	}while(l>0);
	do{
	o-=n;
	k++;
	}while(o>0);
	if(j>k){
	printf("%d日遊べる。\n",i-j);
	}else
	printf("%d日遊べる。\n",i-k);
	
	return 0;
}

C++: #include <iostream>

using namespace std;

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

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);
    int a=A/C,b=B/D;
    if(A%C) a++;
    if(B%D) b++;
    printf("%d\n",L-max(a,b));
}

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

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

    int kl=(a%c==0?a/c:a/c+1);
    int sl=(b%d==0?b/d:b/d+1);
    cout << l-max(kl,sl)<< endl;
    return 0;
}

C++: #include <cmath>
#include <iostream>
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 <iostream>
using namespace std;
int main(void)
{
	int a,b,c,d,e,f,g,h,i,j,k;
	float A;
	cin>>a>>b>>c>>d>>e;
	A=b-d;
	f=0;
	f++;
	for (;;)
	{
		A=A-d;
		if(A>0)
		{
			f++;
		}
		else if (A<=0)
		{
			f++;
			break;
		}
	}
	A=c-e;
	f=0;
	g++;
	for (;;)
	{
		A=A-e;
		if (A>0)
		{
			g++;
		}
		else if (A<=0)
		{
			g++;
			break;
		}
	}
	if (f<=g)
	{
		f=a-f;
		cout<<g<<endl;
	}
	else if(f>=g)
	{ 
		f=a-f;
		cout<<f<<endl;
	}
	return 0;
}