Quotient and Remainder
Python
Easy
2 views
Problem Description
Input has two integers a and b are provided (b != 0). Output quotient (a//b) and remainder (a%b) in one line.
Input Format
One line: a b.
Output Format
One line: q r.
Constraints
b != 0, values fit in 64-bit.
Official Solution
import sys
p=sys.stdin.read().strip().split()
if len(p)<2: sys.exit(0)
a=int(p[0]); b=int(p[1])
sys.stdout.write(f'{a//b} {a%b}')
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!