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<stdio.h>
int main(void)
{
	int L,A,B,C,D;
	int count;
	int count1;

	count=0;
	count1=0;
	
	scanf("%d %d %d %d %d",&L,&A,&B,&C,&D);
		while(0<A){
			A-=C;
			count++;
		}
		while(0<B){	
			B-=D;
			count1++;
		}
				if(count>count1){
					printf("%d\n",L-count);
				}
				else if(count=count1){
					printf("%d\n",L-count);
				}
				else{
					printf("%d\n",L-count1);
				}
	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+b%d) << endl;
}

C++: #include <iostream>

using namespace std;

int f(int a, int b) {
	if (a % b == 0) return a / b;
	return a / b + 1;
}

int main() {
	int l, a, b, c, d; cin >> l >> a >> b >> c >> d;
	int day = max( f(a, c), f(b, d) );
	cout << (l - day) << endl;
}

C++: // 2013/09/10 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/C;
	if(A%C!=0){
		E++;
	}

	int F = B/D;
	if(B%D!=0){
		F++;
	}

	int G;
	if(E>F){
		G = L-E;
	}
	else{
		G = L-F;
	}

	cout << G << '\n';

	return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	int l;
	int a;
	int b;
	int c;
	int d;
	cin >> l;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	int e = a / c;
	int f = b / d;
	int g;
	int h;
	if (e*c == a)
	{
		g = e;
	}
	else
	{
		g = e + 1;
	}
	if (f*d == b)
	{
		h = f;
	}
	else
	{
		h = f + 1;
	}
	if (g < f)
	{
		cout << l - h<< endl;
	}
	else
	{
		cout << l - g << 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>
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;
  }

  cout<<a-ka-ki<<endl;
}

C++: #include<iostream>
using namespace std;
int main(){
  //  for(int i=0;i<5;i++){
  int L,A,B,C,D,rest,try1,try2,goal;
    cin >> L ;
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> D;
    try1=A/C;
    if(A%C>0){try1++;}

    try2=B/D;
    if(B%D>0){try2++;}
    
    if(try1>try2){goal=try1;}
    else{goal=try2;}
    rest=L-goal;
    cout << rest << endl;


  
  return 0;
}

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

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

int main(void)
{
	int l,a,b,c,d;
	int koku,suu,mn;
	scanf("%d %d %d %d %d",&l,&a,&b,&c,&d);
	koku=a/c;
	if(a%c!=0)	koku++;
	suu=b/d;
	if(b%d!=0)	suu++;
	mn=max(koku,suu);
	printf("%d\n",l-mn);
	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>
using namespace std;

int n;
int a,b;
int aa,bb;
int ares,bres;
int main(void){
	scanf("%d",&n);
	scanf("%d%d",&a,&b);
	scanf("%d%d",&aa,&bb);
	ares=a/aa;
	if(a%aa>0)ares++;
	bres=b/bb;
	if(b%bb>0)bres++;
	ares=n-ares;
	bres=n-bres;
	printf("%d\n",min(ares,bres));
	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);
}

C++: #include<iostream>
using namespace std;
int main(){
	int l;
	int a;
	int b;
	int c;
	int d;
	int i=0;
	int s=0;
	int n=0;
	cin>>l;
	cin>>a;
	cin>>b;
	cin>>c;
	cin>>d;
	i=a%c;
	s=(a-i)/c;
	if(i!=0){
		s=s+1;
	}
	i=b%d;
	n=(b-i)/d;
	if(i!=0){
		n=n+1;
	}
	if(s<n){
		s=l-n;
	}else{
		s=l-s;
	}
	cout<<s<<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 }) << 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);
	printf("%d\n",L-max((a+d-1)/d,(b+c-1)/c));
	return 0;
}

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

#define PI 3.1415926
void swap(int* x, int* y) {
	int a = *x;
	int b = *y;
	*x = b;
	*y = a;
}
int factorial(int n);
int sum(int n, int*);
int ave(int n, int*);
int min(int n, int*), min(int n, int m);
int max(int n, int*), max(int n, int m);

int main() {
	int L, A, B, C, D,ans1,ans2;
	scanf("%d %d %d %d %d", &L, &A, &B, &C, &D);
	ans1 = L - A / C-1;
	if (A%C == 0) {
		ans1++;
	}
	ans2 = L - B / D-1;
	if (B%D==0) {
		ans2++;
	}
	printf("%d\n", min(ans1,ans2));
	return 0;
}

int factorial(int n) {
	if (n > 0) {
		return n * factorial(n - 1);
	}
	else {
		return 1;
	}
}
int sum(int n, int *all) {
	int total = 0;
	for (int i = 0; i < n; ++i) {
		total += all[i];
	}
	return total;
}
int ave(int n, int *all) {
	int total = 0;
	for (int i = 0; i<n; ++i) {
		total += all[i];
	}
	return total / n;
}
int min(int n, int *all) {

	int min = all[0];
	for (int i = 1; i < n; ++i) {
		if (all[0] > all[i]) {
			min = all[i];
		}
	}
	return min;
}
int max(int n, int *all) {
	int max = all[0];
	for (int i = 1; i<n; ++i) {
		if (all[0]<all[i]) {
			max = all[i];
		}
	}
	return max;
}
int max(int n, int m) {
	if (n >= m) {
		return n;
	}
	else {
		return m;
	}
}
int min(int n, int m) {
	if (n >= m) {
		return m;
	}
	else {
		return n;
	}
}

C++: #include <iostream>

using namespace std;

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

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

int main() {

	//ifstream cin("INPUT.txt");
	//ofstream cout("OUTPUT.txt");

	int day, koku, suu, kokud, suud;
	cin >> day >> koku >> suu >> kokud >> suud;
	cout << day - max(koku % kokud == 0 ? koku / kokud : koku / kokud + 1, koku % kokud == 0 ? suu / suud : suu / suud + 1) << endl;

	return 0;

}

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