Integer division and remainder of two natural numbers

Write a program that reads two natural numbers a and b, with b > 0, and
prints the integer division d and the remainder r of a divided by b.

Remember that, by definition, d i r must be the only integer numbers
such that 0 ≤ r < b and d ⋅ b + r = a.

Input

Input consists of a and b, with b > 0.

Output

Print a line with the integer division and the remainder of a divided by
b, separated by a space.

Observation

Although the conditions for the input of this exercise prevent divisions
by zero, check what happens to your program in that case.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:25:50.604Z

© Jutge.org, 2006–2026.
https://jutge.org
