https://www.acmicpc.net/problem/5532
#include <iostream>
using namespace std;
int main() {
int l,a,b,c,d;
cin>>l>>a>>b>>c>>d;
int sum=0;
int sum1=0;
if(a%c==0) sum=a/c;
else sum=a/c+1;
if(b%d==0) sum1=b/d;
else sum1=b/d+1;
cout<<min(l-sum,l-sum1);
}