Editorial for MALD Contest 1 P2 - Scratch Cat and Examinations
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
The intended solution is to implement the ceiling division. Using double and built-in ceiling functions isn't accurate enough due to floating-point precision errors (unless you use -bit floating point). Division with two integers using the built-in division operator is floor division (e.g. ). To implement ceiling division with integers, you can simply use under the given constraints.
Complexity:
Comments