#importing modules
import math
from __future__ import division
#Variable declaration
D=41; #divisor
d=15625; #dividend
#Calculation
q=d/D; #quotient
r=d%D; #remainder
#Result
print "quotient is",q
print "remainder is",r
#importing modules
import math
from __future__ import division
#Variable declaration
D=397246; #dividend
r=211; #remainder
q=865; #quotient
#Calculation
d=(D-r)/q; #divisor
#Result
print "divisor is",d
#importing modules
import math
from __future__ import division
#Variable declaration
d=87375; #dividend
D=698; #divisor
#Calculation
r=d%D; #remainder
#Result
print "least number to be subtracted is",r
#importing modules
import math
from __future__ import division
#Variable declaration
d=49123; #dividend
D=263; #divisor
#Calculation
r=d%D; #remainder
l=D-r; #least number to be added
#Result
print "least number to be added is",l
#importing modules
import math
from __future__ import division
#Variable declaration
d=999; #dividend
D=35; #divisor
#Calculation
r=d%D; #remainder
rn=d-r; #required number
#Result
print "required number is",rn
#importing modules
import math
from __future__ import division
#Variable declaration
d=100; #dividend
D=14; #divisor
#Calculation
r=d%D; #remainder
rn=d+D-r; #required number
#Result
print "required number is",rn
#importing modules
import math
from __future__ import division
#Variable declaration
d=602; #dividend
D=14; #divisor
rl=36; #remainder
#Calculation
k=d/D; #quotient
rs=rl-(2*D); #required remainder
#Result
print "required remainder is",rs
#importing modules
import math
from __future__ import division
#Variable declaration
d=357; #dividend
D=17; #divisor
rs=5; #remainder
#Calculation
k=d/D; #quotient
rl=(2*D)+rs; #required remainder
#Result
print "required remainder is",rl
#importing modules
import math
from __future__ import division
#Variable declaration
a=30;
b=27;
c=41; #numbers in decimal form
#Calculation
ba=bin(a); #binary equivalent of 30
bb=bin(b); #binary equivalent of 27
bc=bin(c); #binary equivalent of 41
#Result
print "binary equivalent of 30 is",ba
print "binary equivalent of 27 is",bb
print "binary equivalent of 41 is",bc
#importing modules
import math
from __future__ import division
#Variable declaration
a='10110'
b='1011'
c='1001'
d='1010'
e='101'
f='100'
g='1100'
h='11'
i='101'
j='1100'
k='10'
#Calculation
a_b=bin(int(a,2)-int(b,2)); #result of 10110-1011
c_d=bin(int(c,2)+int(d,2)); #result of 1001+1010
e_f=bin(int(e,2)*int(f,2)); #result of 101*100
gh1=int(g,2);
gh2=int(h,2);
gh=int(gh1/gh2);
g_h=bin(gh); #result of 1100/11
j_k=bin(int(int(j,2)/int(k,2))); #result of 1100/10
i_j_k=bin(int(i,2)+int(j_k,2)); #result of 101+1100/10
#Result
print "result of 10110-1011 is",a_b
print "result of 1001+1010 is",c_d
print "result of 101*100 is",e_f
print "result of 1100/11 is",g_h
print "result of 101+1100/10 is",i_j_k