#K1191. Azembler Division Using Repeated Subtraction
Azembler Division Using Repeated Subtraction
Azembler Division Using Repeated Subtraction
In this problem, you are required to perform division by repeatedly subtracting the divisor from the dividend until the remaining value is less than the divisor. In each subtraction, you count one operation. Formally, given two positive integers (n) (the dividend) and (d) (the divisor), find the quotient (q) and remainder (r) such that (n = q \times d + r) with (0 \le r < d). Additionally, return the number of subtraction operations performed, which is equal to (q). Your task is to implement this logic and output the three values: quotient, remainder, and count of operations.
inputFormat
The input consists of two space-separated integers, where the first integer is the dividend (n) and the second is the divisor (d). You can assume that (d > 0).
outputFormat
Output three space-separated integers: the quotient, the remainder, and the number of subtraction operations performed.## sample
10 3
3 1 3
</p>