Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.
Given an improper fraction (as the numerator and the denominator ), determine and print it in mixed fraction form.
Here are a few examples of improper and mixed fractions:
Improper | Mixed |
---|---|
The input will contain two integers () and ().
All test cases will always produce a valid mixed fraction.
Print three integers: the whole number, the numerator and the denominator of the mixed fraction, each separated by a space.
Input | Output |
---|---|
9 5 | 1 4 5 |
98% Solution Ratio
hasanakhiarEarliest,
hasanakhiarFastest, 0.0s
akashmbstuLightest, 0 B
n4o847Shortest, 26B
Login to submit
This problem requires some basic integer arithmetic: Let us consider NNN (the numerator) to be 9 and...