간단한 수학 문제였다.
조심해야 할 부분은 소의 마리 수 보다 면적이 더 넓은 경우에는 소의 개수만큼만 출력해야 한다.
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cmath>
#include <cstring>
#include <bitset>
#define xx first
#define yy second
#define all(x) (x).begin(), (x).end()
using namespace std;
using i64 = long long int;
using ii = pair<int, int>;
using iis = pair<int, string>;
using ii64 = pair<i64, i64>;
using iii = tuple<int, int, int>;
int main() {
int n, w, h, l;
scanf("%d %d %d %d", &n, &w, &h, &l);
printf("%d", min(n, (w / l) * (h / l)));
return 0;
}
'백준' 카테고리의 다른 글
1572 중앙값 (0) | 2021.05.01 |
---|---|
16426 '나교수' 교수님의 악필 (0) | 2021.04.24 |
9436 Round Robin (0) | 2021.04.24 |
1697 숨바꼭질 (0) | 2021.04.16 |
10451 순열 사이클 (2) | 2021.04.16 |