Using divmod in this solution