Official
A - 落葉の掃除 / Fallen Leaves Cleaning Editorial by admin
swe-2-highSolution
The total number of fallen leaves is \(A \times B\). Takahashi can clean at most \(C\) leaves per day for \(D\) days, so the maximum number of leaves he can clean is \(C \times D\).
Therefore, we output Yes if
\[A \times B \leq C \times D\]
holds, and No otherwise.
Proof of Correctness
- Sufficiency: If \(A \times B \leq C \times D\), then by cleaning up to \(C\) leaves each day, the total cleaning capacity over \(D\) days is at least the total number of leaves, so all leaves can be cleaned.
- Necessity: In \(D\) days, at most \(C \times D\) leaves can be cleaned no matter what. If \(A \times B > C \times D\), the total number of leaves exceeds the capacity, making it impossible to finish cleaning all of them.
Hence the condition \(A \times B \leq C \times D\) is necessary and sufficient, and the check is correct.
Complexity
- Time: \(O(1)\)
- Space: \(O(1)\) (only four integers are read)
Within the constraints, \(A \times B\) and \(C \times D\) are at most \(10^6\), so 32-bit integers suffice; we use long long in C++ for safety anyway.