#MTHA0000001. Thương và số dư (Quotient and Remainder)
Thương và số dư (Quotient and Remainder)
Quotient and Remainder
Version: Phuoc Hung OJ Extended
Problem Statement
Given two positive integers and , integer division determines unique integers and such that and . Determine the quotient and remainder .
Input
One line contains two positive integers and .
Output
Print two integers and : the integer quotient and the remainder when dividing by .
Subtasks
- Subtask 1 (30 points):
- .
- .
- Subtask 2 (70 points):
- .
- .
Examples
Example 1
Input
47 6
Output
7 5
Explanation
Since , the quotient is and the remainder is .
Example 2
Input
81 9
Output
9 0
Explanation
Since , the remainder is .
Example 3
Input
5 12
Output
0 5
Explanation
Because , no full group of size can be formed; the quotient is and the remainder is .