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 "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer"
int main() {
	int L, A, B, C, D; cin >> L >> A >> B >> C >> D;
	int a = (A - 1) / C+1;
	int b = (B -1) / D + 1;
	cout << L - max(a, b) << endl;
	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
	int l, a, b, c, d,cnt=0;
	cin >> l >> a >> b >> c >> d;
	while (a>0||b>0)
	{
		a -= c;
		b -= d;
		cnt++;
	}
	cout << l - cnt << endl;
	return 0;
}

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

int main(){
  int dy,a,b,c,d;
  int ans,mini;
  cin >> dy >> a >> b >> c >> d;
  if(a % c == 0) mini = a / c;
  else mini = a / c + 1;
  if(b % d == 0) mini = max(mini,b/d);
  else mini = max(mini,b/d+1);
  cout << dy - mini << endl;
}

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

C++: #include<iostream>
using namespace std;
int main(){
  int a,b,c,d,l;
  cin >> l >> a >> b >> c >> d;
  while(a>0 || b>0){
    l--;
    a-=c;
    b-=d;
  }
  cout << l << endl;
}

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

using namespace std;

int main()
{
	int N, A, B, C, D;

	cin >> N >> A >> B >> C >> D;

	cout << min((N * C - A) / C, (N * D - B) / D) << endl;

	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
using namespace std;
int main()
{
	int a, b, c, d, e, i, j, k, l, m, n, o, p, q, r;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	cin >> e;
	j = d%b;
	if (j>0)
	{
		b = b / d;
		b = b + 1;
	}
	else if (j == 0)
	{
		b = b / d;
	}
	i = e%c;
	if (i>0)
	{
		c = c / e;
		c = c + 1;
	}
	else if (i == 0)
	{
		c = c / e;
	}
	a=a-max(b, c);
	cout <<a<< endl;
	return 0;
}

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

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

int main() {
    int day;
    cin>>day;
    int math,jap;
    cin>>math>>jap;
    int dom,doj;
    cin>>dom>>doj;
    
    cout<<day-max( ceil((double)math/dom),ceil((double)jap/doj) )<<endl;
    
    
    
    return 0;
}

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

int main(){
    int l,a,b,c,d;
    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;;
}

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

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

	a = A/C;
	if(A%C>0){
	a++;	
	}
	b = B/D;
	if(B%D>0){
	b++;
	}

	if(a>b){
		cout << L-a << "\n";
	}else{
		cout << L-b << "\n";
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void){
    int days, A, B, maxA, maxB;
	int* inputs[] = {&days, &A, &B, &maxA, &maxB};
	for (int i = 0; i < (sizeof inputs / sizeof inputs[0]); i++) {
		cin >> *inputs[i];
	}

	int dayA = (A % maxA == 0) ? (A / maxA) : (A / maxA + 1);
	int dayB = (B % maxB == 0) ? (B / maxB) : (B / maxB + 1);
	int dayHw = days - ((dayA >= dayB) ? dayA : dayB);

	cout << dayHw << endl;
}

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;
  }
  if(ka>ki){
  cout<<a-ka<<endl;
  }else{
    cout<<a-ki<<endl;
}

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

C++: #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
 
//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int main()
{
	int l;
	cin >> l;
	int a, b, c, d;
	int count = 0;
	cin >> a >> b >> c >> d;

	while (a > 0 or b > 0){
		a -= c;
		b -= d;
		count++;
	}

	cout << l - count << endl;
}

C++: #include <iostream>

using namespace std;

int main(){
	int day, a, b, a1, b1, x, y;
	cin >> day >> a >> b >> a1 >> b1;

	x = a / a1;
	y = b / b1;

	if (a % a1 != 0) x += 1;
	if (b % b1 != 0) y += 1;

	if (x > y) printf("%d", day - x);
	else printf("%d", day - y);

	return 0;
}