#include <iostream>
#include <algorithm>
using namespace std;
int main(void) {
int l, a, b, c, d,homeworkday;
cin >> l >> a >> b >> c >> d;
if (a%c == 0)
homeworkday = a / c;
else
homeworkday = a / c + 1;
if(b%d==0)
homeworkday = max(homeworkday,b/d);
else
homeworkday = max(homeworkday, b/d+1);
cout << l - homeworkday << endl;
return 0;
}
'백준 알고리즘 > 시뮬레이션' 카테고리의 다른 글
백준 5397번 C++ (0) | 2019.08.29 |
---|---|
백준 2161번 C++ (0) | 2019.08.28 |
백준 2164번 C++ (0) | 2019.08.28 |
백준 15685번 C++ (0) | 2019.08.28 |
백준 14503번 C++ (0) | 2019.08.28 |