https://www.acmicpc.net/problem/19698
#include <iostream> using namespace std; int main() { int n,w,h,l; cin>>n>>w>>h>>l; w/=l; h/=l; int sum=w*h; if(n>=sum) cout<<sum; else cout<<n; }