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 a, sum = 0;
for (int i = 0; i < 4; i++) {
cin >> a;
sum += a;
}
cout << sum / 60 << endl << sum % 60 << endl;
}*/
/*#include<iostream>
using namespace std;
int main() {
int min1 = 2000, min2 = 2000, a;
for (int i = 0; i < 3; i++) {
cin >> a;
if (min1 > a)min1 = a;
}
for (int i = 0; i < 2; i++) {
cin >> a;
if (min2 > a)min2 = a;
}
cout << min1 + min2-50 << endl;
}*/
#include<iostream>
using namespace std;
int main() {
int a[5], b[2] = {1}, sum = 0;
for (int i = 0; i < 5; i++) {
cin >> a[i];
}
while (a[1] > a[3]*b[0]) {
b[0]++;
//cout << "bakatoy" << endl;
}
while (a[2] > a[4]*b[1]) {
b[1]++;
//cout << "bakatoy" << endl;
}
if (b[0] > b[1]) {
cout << a[0]-b[0] << endl;
}
else {
cout << a[0]-b[1] << endl;
}
}
/*#include<iostream>
using namespace std;
int main() {
	int a, sum=0;
	for (int i = 0; i<5; i++) {
		cin >> a;
		if (a < 40)a = 40;
		sum += a;
	}
	cout << sum / 5 << endl;
}*/

C++: #include <iostream>
using namespace std;
int main(){
        int vacation,japanese,math,japanese_max,math_max;
        cin >> vacation ;
        cin >> japanese >> math;
        cin >> japanese_max >> math_max;
        int japanese_day= japanese/japanese_max;
        if( japanese%japanese_max )
                japanese_day++;
        int math_day = math/math_max;
        if( math%math_max )
                math_day++;
        int ans;
        math_day > japanese_day?ans=math_day:ans=japanese_day;
        cout << vacation-ans << endl;
        return 0;
}

C++: #include<iostream> JOI 2012 ???1
using namespace std;
int main(void)
{
	int nisu, kok, suu, saik, sais;
	int max,su,ko;
	cin >> nisu >> kok >> suu >> saik >> sais;
	ko = kok / saik;
	if (kok%saik > 0) {
		ko++;
	}
	su = suu / sais;
	if (suu%sais > 0) {
		su++;
	}
	if (ko > su) {
		max = ko;
	}
	else {
		max = su;
	}
	cout << nisu - max << endl;
	return 0;
}

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

C++: #include<stdio.h>
int main(void)
{
	int l,a,b,c,d,kok1,kok2,kok3,san1,san2,san3,ans,x;
	scanf("%d %d %d %d %d",&l,&a,&b,&c,&d);
	kok1=a/c;
	kok2=a%c;
	san1=b/d;
	san2=b%d;
	if(kok2>=1){
		kok3=kok1+1;
	}
	if(san2>=1){
		san3=san1+1;
	}
	if(kok3<=san3){
		ans=san3;
	}
	else if(san3<=kok3){
		ans=kok3;
	}
	x=l-ans;
	printf("%d\n",x);
	return 0;
}

C++: #include<iostream>

using namespace std;
int main(){
	int d;
	cin>>d;
	int koku,san,x,y;
	cin>>koku>>san>>x>>y;
	cout<<d-max(koku/x+(koku%x!=0),san/y+(san%y!=0))<<endl;
}

C++: #include<bits/stdc++.h>
using namespace std ;
int main()
{
    int homework[5] = {0} ; //{ day , Japanese , Math , maxJapanesePage , maxMathPage }
    int freeday = 0 ;
    for ( int i = 0 ; i < 5 ; i++ )
    {
        cin >> homework[i] ;
    }
    freeday = homework[0] - max( ceil( (double)homework[1]/homework[3] ) , ceil( (double)homework[3]/homework[4] ) ) ;
    cout << freeday << endl ;

    return 0 ;
}

C++: #include <stdio.h>

int main(){
	int l,a,b,c,d,p=0,q=0;
	scanf("%d %d %d %d %d",&l,&a,&b,&c,&d);
	while(a>0){
		a=a-c;
		p++;
	}
	while(b>0){
		b=b-d;
		q++;
	}
	if(p-q>0){
		l=l-p;
	}else{
		l=l-q;
	}
	printf("%d\n",l);
	return 0;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
using namespace std;
int main(){
	
	int L,A,B,C,D;
	
	cin>>L>>A>>B>>C>>D;
	
	for(;L>=0;L--){
		A-=C;
		B-=D;
		if(A<=0&&B<=0)
			break;
	}
	
	cout<<L-1<<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 != 0) q = q+1;
	w = c / e;
	if (c%e != 0) w = w+1;
	cout << a - max({ q,w }) << endl;
}

C++: #! /usr/bin/env ruby
# coding: utf-8
L = gets.to_i
A = gets.to_i
B = gets.to_i
C = gets.to_i
D = gets.to_i
puts L - [(A + C - 1)/C.to_i, (B + D - 1)/D.to_i].max

C++: 
#include <stdio.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<stdio.h>
int main()
{
	int a,b,c,d,l,s,k,r;
	scanf("%d%d%d%d%d",&l,&a,&b,&c,&d);
	k=a/c;
	s=b/d;
	if(a%c!=0){
		k++;
	}
	if(b%d!=0){
		s++;
	}
	if(k>s){
		r=l-k;
	}else{
		r=l-s;
	}
	printf("%d\n",r);
	return 0;
}

C++: #include <stdio.h>

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

C++: #include <stdio.h>
int main() {
int L,A,B,C,D,x,y;
    scanf("%d",&L); 
    scanf("%d",&A); 
    scanf("%d",&B); 
    scanf("%d",&C);
    scanf("%d",&D);
    x = L - A/C;
    y = L - B/D;
    if(x>y) {  
       printf("%d\n",x);
    }else {
       printf("%d\n",y);
    }
    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,t=0;
	cin>>num1>>num2>>num3>>num4>>num5;
	num6=num2/num3;
	num7=num2%num3;
	if(num7!=0){
		num6=num6+1;
	}
	num8=num4/num5;
	num9=num4%num5;
	if(num9!=0){
		num8=num8+1;
	}
	if(num6<num8){
		t=num6;
		num6=num8;
		num8=t;
	}
	num9=num1-num6;
	cout<<num9;
	cout<<"\n";
	return 0;
}

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

C++: #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int tino,tiya,kokoa,rize,syaro;
    cin>>tino>>tiya>>kokoa>>rize>>syaro;
    int gotiusa=0;
    int aoayama=0;
    cout<<tino-max((int)(double(tiya)/rize+0.5),(int)((double)(kokoa/syaro)+0.5))<<endl;
}