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++: // -*- coding: utf-8 -*-
// Last-Updated : <2014/06/19 18:14:34 by samui>

#include <iostream>
#include <cstdio>
#include <string>

#include <vector>

int main(int argc, char **argv){
  int L,A,B,C,D;
  std::cin>>L;
  std::cin>>A;
  std::cin>>B;
  std::cin>>C;
  std::cin>>D;
  while(A>0 || B >0){
    A-=C;
    B-=D;
    L--;
  }
  std::cout<<L<<std::endl;
  return 0;
}

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

C++: #include <cstdio>
#include <algorithm>
using namespace std;
int main() {
    int N, mp, lp, mm, lm;
    scanf("%d", &N);
    scanf("%d %d", &mp, &lp);
    scanf("%d %d", &mm, &lm);
    std::printf("%d\n", N - max(((mp % mm == 0)? mp/mm : mp/mm+1), ((lp % lm == 0)? lp/lm : lp/lm+1)));
    return 0;
}

C++: #include<iostream>
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-1)-(a-1)%c)/c+1,((b-1)-(b-1)%d)/d+1));
}

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;
	g=0;
	g++;
	for (;;)
	{
		if (A<=0)
		{
			g++;
			break;
		}
		else if (A>0)
		{
			g++;
		}
	}
	A=c-e;
	f=0;
	f++;
	for (;;)
	{
		 if (A<=0)
		{
			f++;
			break;
		}
		A=A-e;
		else if (A>0)
		{
			f++;
		}
	}
	if (f<=g)
	{
		g=a-g;
		cout<<g<<endl;
	}
	else if(f>=g)
	{ 
		f=a-f;
		cout<<f<<endl;
	}
	return 0;
}

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

	}
	printf("%d\n", a[1]-ruio);
	return 0;
}

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("%d\n",s);
	if(a%c!=0){
	s=s+1;
	}
	ss=b/d;
//	printf("%d\n",ss);
	if(b%d!=0){
		ss=ss+1;
	}
	
	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<stdio.h>
int main(void)
{
	int i,a,b,c,d,e,X=0;
	scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
	for(i=0;i<a;i++){
		if(b<=0&&c<=0){
			X++;
		}
		else{
			b-=d;
			c-=e;
		}
	}
	printf("%d\n",X);
	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 cnt = 0;
    while (A > 0 || B > 0) {
        A -= C;
        B -= D;
        cnt++;
    }
    cout << L - cnt << endl;
    return 0;
}

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

using namespace std;

int main(void)
{
	//freopen("C:\\Users\\h2539\\Desktop\\in.txt","r",stdin);
	//freopen("C:\\Users\\h2539\\Desktop\\out.txt","w",stdout);

	int L, A, B, C, D;

	// L : 日数 |  A : 国語p |  B : 算数p  |  C : 国語max |   D : 算数max
	cin >> L >> A >> B >> C >> D;

	int a = A, b = B, i = 0;

	for(i = 0; !(a <= 0 && b <= 0) ; i++)
	{
			a -= C;
			b -= D;
	}

	cout << L - i << endl;

	return 0;
}

C++: #include <cstdio>

using namespace std;

int main()
{
	int day, a, b, c, d;
	
	scanf("%d %d %d %d %d", &day, &a, &b, &c, &d);
	
	while(a > 0 || b > 0){
		
		a -= c;
		b -= d;
		day--;
	}
	
	printf("%d\n", day);
	
	return (0);
}

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

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

int main(){
int a,b,c,d,e;
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
(b%d)?(b=b/d+1):(b=b/d);
(c%e)?(c=c/e+1):(c=c/e);
printf("%d\n",20-max(b,c));
}

C++: #include <iostream>

using namespace std;

int main(void) {
  int l;
  int a, b;
  int c, d;
  int i;

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

  for(i = 1; ; i++) {
    a -= c;
    b -= d;
    if(a <= 0 && b <= 0) break;
  }

  cout << l - i << endl;

  return 0;
}

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

using namespace std;

#define REP(i,n) for (int i=0;i<(n);++i)

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

	int day = max(ceil((double)a / c), ceil((double)b / d));
	int ans = l - day;
	cout << ans << endl;

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)

int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int l,a,b,c,d;
  cin>>l>>a>>b>>c>>d;
  int res = max(1.0*a/c+0.9,1.0*b/d+0.9);
  cout<<l-res<<endl;
  
}

C++: #include <iostream>
#include <algroithm>
#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>
#include <algorithm>

using namespace std;

int main(void)
{
	int a, b, c, d, l;
	
	scanf("%d\n%d\n%d\n%d\n%d", &l, &a, &b, &c, &d);
	
	printf("%d\n", l - max((a + c - 1) / c, (b + d - 1) / d));
	
	return (0);
}

C++: #include<iostream>

using namespace std;

int main(){

  int l,a,b,c,d,x,y;

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

  x=a/c;

  if((a%c)!=0){
    x=x+1;
  }


  y=b/d;

  if((b%d)!=0){
    y=y+1;
  }

  if(x>y){
    cout<<l-x<<endl;
  }else if(x<y){
    cout<<l-y<<endl;
  }else{
    cout<<l-x<<endl;
  }


  return 0;
}

C++: #include<iostream>

using namespace std;

int main(){

  int A, B, C, D, L;
  int date_langue, date_math, date_play;
  int tmp;
  
  while(1){
    cin >> L >> A >> B >> C >> D;
    
    date_langue = A/C;

    tmp = A%C;
    if(tmp > 0)
      date_langue ++;

    date_math = B/D;
    tmp = B%D;
    if(tmp > 0)
      date_math ++;
 
    if(date_langue > date_math){
      date_play = L - date_langue;
    }else date_play = L - date_math;
    
    cout << date_play << endl;
    break;
  }
}

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

using namespace std;

int main() {
  int l, a,b,c,d,i,j;
  i = j = 0;
  cin >> l >> a >> b >> c >> d;
  while(a>0){
    a-=c;i++;
  }
  while(b>0){
    b-=d;j++;
  }
  
  cout <<  l -  max(i, j)  << endl;

  return 0;
}

C++: #include <iostream>
#include <functional>
#include <algorithm>
#include <climits>
#include <string>
#include <vector>
#include <map>
#include <cmath>

using namespace std;

namespace _{struct _{_(){ // initialize
  cin.tie(0); ios::sync_with_stdio(false);
}}_;}
template <typename T, size_t size>
inline size_t len(const T (&)[size]) { return size; }
#define println(s) cout << s << '\n';
#define str to_string
#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()


int main() {
  int L, A, B, C, D;
  cin >> L >> A >> B >> C >> D;
  cout << L - max((int)ceil((float)A/C), (int)ceil(((float)B/D))) << '\n';
  return 0;
}

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