Official
A - 化繊のリボン / Synthetic Fiber Ribbon Editorial by admin Editorial for printing
swe-2-highExplanation
Cutting the ribbon into pieces of length \(B\) yields \(\lfloor A/B \rfloor\) pieces with a remainder of \(A \bmod B\) cm. No remainder is left exactly when \(A\) is divisible by \(B\), i.e., \(A \bmod B = 0\).
The program computes \(a \bmod b\) and prints Yes if it is \(0\), otherwise No. A direct modulo check suffices — no simulation of the cutting process is needed.
Complexity
Only two integers are read, so both time and space are \(O(1)\).
posted:
last update: