One of the built-in functions of Python is divmod, which takes two arguments $\boldsymbol{\alpha}$ and $\boldsymbol{b}$ and returns a tuple containing the quotient of $a/b$ first and then the remainder $\boldsymbol{a}$.  

For example:  

>>> print divmod(177,10)
(17, 7)

Here, the integer division is 177/10 => 17 and the modulo operator is 177%10 => 7.

Task 

Read in two integers, $\boldsymbol{a}$ and $\boldsymbol{b}$, and print three lines. 

The first line is the integer division $\boldsymbol{a}//b$ (While using Python2 remember to import division from __future__). 

The second line is the result of the modulo operator: $a\%b$. 

The third line prints the divmod of $\boldsymbol{a}$ and $\boldsymbol{b}$.  

Input Format 

The first line contains the first integer, $\boldsymbol{a}$, and the second line contains the second integer, $\boldsymbol{b}$.   

Output Format 

Print the result as described above.  

Sample Input  

177
10

Sample Output  

17
7
(17, 7)

Source: hackerrank | Difficulty: EASY
Tags: Mathematics


Solutions:
operand1 = int(input())
operand2 = int(input())
print(operand1 // operand2)
print(operand1 % operand2)
print(divmod(operand1, operand2))


a = int(input())
b = int(input())
c = a // b
d = a % b
e = divmod(a, b)
print(c)
print(d)
print(e)


import sys
a = int(input())
b = int(input())
print(a // b)
print(a % b)
print(divmod(a, b))


(a, b) = (int(input()), int(input()))
print(a // b)
print(a % b)
print(divmod(a, b))


a = int(input())
b = int(input())
print(a // b)
c = a % b
print(c)
print(divmod(a, b))


esimene = int(input())
teine = int(input())
print(esimene // teine)
print(esimene % teine)
print(divmod(esimene, teine))


output = divmod(int(input().strip()), int(input().strip()))
print(output[0])
print(output[1])
print(output)


a = int(input())
b = int(input())
print(a // b)
print(a % b)
tup = (a // b, a % b)
print(tup)


a = int(input())
b = int(input())
c = a // b
d = a % b
print(c)
print(d)
output = '(' + str(c) + ', ' + str(d) + ')'
print(output)


a = int(input())
b = int(input())
x = divmod(a, b)
print(a // b)
print(a % b)
print(x)


a = int(input())
b = int(input())
print(a // b)
print(a % b)
print((a // b, a % b))


a = int(input())
b = int(input())
(r, s) = divmod(a, b)
print(r)
print(s)
print((r, s))


a = int(input())
b = int(input())
c = divmod(a, b)
print(c[0])
print(c[1])
print(c)


v1 = int(input())
v2 = int(input())
print(v1 // v2)
print(v1 % v2)
print(divmod(v1, v2))


a = int(input())
b = int(input())
print(a // b)
print(a % b)
print('(' + str(a // b) + ', ' + str(a % b) + ')')


int1 = int(input())
int2 = int(input())
print(int1 // int2)
print(int1 % int2)
print(divmod(int1, int2))


x = int(input())
y = int(input())
print(x // y)
print(x % y)
print(divmod(x, y))


a = int(input(''))
b = int(input(''))
print(a // b)
print(a % b)
print(divmod(a, b))


first_num = int(input())
second_num = int(input())
dvmd = divmod(first_num, second_num)
print(dvmd[0], dvmd[1], dvmd, sep='\n')


a = int(input())
b = int(input())
(c, d) = divmod(a, b)
print(c)
print(d)
print(divmod(a, b))


numa = int(input())
numb = int(input())
print(numa // numb)
print(numa % numb)
print(divmod(numa, numb))


num1 = int(input())
num2 = int(input())
print(num1 // num2)
print(num1 % num2)
print(divmod(num1, num2))


a = int(input())
b = int(input())
dvmd = divmod(a, b)
(dv, md) = dvmd
print(dv)
print(md)
print(dvmd)


a = int(input())
b = int(input())
d = divmod(a, b)
print(d[0])
print(d[1])
print(d)


a = int(input())
b = int(input())
print(a // b)
print(a % b)
print(divmod(a, b))


n = int(input())
m = int(input())
l = ()
l = divmod(n, m)
print(l[0])
print(l[1])
print(l)


a = input()
b = input()
a = int(a)
b = int(b)
print(a // b)
print(a % b)
print(divmod(a, b))


a = input()
b = input()
(a, b) = (int(a), int(b))
print(a // b)
print(a % b)
print(divmod(a, b))


a = int(input())
b = int(input())
div = a // b
mod = a % b
print(div)
print(mod)
print((div, mod))


first = int(input())
second = int(input())
print(first // second)
print(first % second)
print(divmod(first, second))


a = int(input().strip())
b = int(input().strip())
print(a // b)
print(a % b)
print(divmod(a, b))


a = int(input())
b = int(input())
print(int(a / b))
print(a % b)
print(divmod(a, b))


one = int(input())
two = int(input())
print(one // two)
print(one % two)
print(divmod(one, two))


(m, n) = (int(input()), int(input()))
print(m // n)
print(m % n)
print(divmod(m, n))


num1 = int(input())
num2 = int(input())
integer = num1 // num2
modulo = num1 % num2
z = divmod(num1, num2)
print(integer)
print(modulo)
print(z)


a = int(input())
117
b = int(input())
10
print(a // b)
print(a % b)
x = divmod(a, b)
print(x)


import sys
a = int(sys.stdin.readline())
b = int(sys.stdin.readline())
print(a // b)
print(a % b)
print(divmod(a, b))


a = input()
b = input()
print(int(a) // int(b))
print(int(a) % int(b))
print(divmod(int(a), int(b)))