#BOX Class multiple inheritance to weightbox and weightcolor
class box():
def __init__(self,lenght,breadth,height):
self.l=lenght
self.b=breadth
self.h=height
def volume(self):
volume=self.l*self.b*self.h
print("volume: ", volume)
def display(self):
print("height: ", self.h)
print("lenght: ", self.l)
print("breadth: ", self.b)
class weightbox(box):
def __init__(self,l,b,h,w):
box.__init__(self,l,b,h)
self.w=w
def display(self):
box.display(self)
print("weight: ", self.w)
class colorweight(weightbox):
def __init__(self,l,b,h,w,c):
weightbox.__init__(self,l,b,h,w)
self.c=c
def display(self):
weightbox.display(self)
print("colour: ", self.c)
#check if date d1<d2 or d1>d2 or d1=d2 using operation overloading of compatison operators
class dates():
def __init__(self,day,month,year):
self.d=day
self.m=month
self.y=year
def display(self):
print("date: ", self.d, "/", self.m,"/", self.y)
def __lt__(self,other):
if self.y<other.y:
print("True")
elif self.y==other.y:
if self.m<other.m:
print("True")
elif self.m==other.m:
if self.d<other.d:
print("True")
else:
print("False")
def __gt__(self,other):
if self.y>other.y:
print("True")
elif self.y==other.y:
if self.m>other.m:
print("True")
elif self.m==other.m:
if self.d>other.d:
print("True")
else:
print("False")
def __eq__(self,other):
if self.y==other.y and self.m==other.m and self.d==other.d:
print("True")
else:
print("False")
d1=dates(18,1,2024)
d2=dates(18,1,2026)
d1.display()
d2.display()
d3=(d1>d2)
#add,sub,multiply and divide distances using operation overloading of arithematic opeartors
class distance():
def __init__(self,kilometers,meters):
self.k=kilometers
self.m=meters
def display(self):
print(self.k,self.m)
def __add__(self,other):
d1=(self.k*1000)+self.m
d2=(other.k*1000)+other.m
d3=d1+d2
d4,d5=d3//1000,d3%1000
d6=distance(d4,d5)
return d6
def __sub__(self,other):
d1=(self.k*1000)+self.m
d2=(other.k*1000)+other.m
if d1>d2:d3=d1-d2
else:d3=d2-d1
d4,d5=d3//1000,d3%1000
d6=distance(d4,d5)
return d6
def __mul__(self,other):
d1=(self.k*1000)+self.m
d2=(other.k*1000)+other.m
d3=d1*d2
d4,d5=d3//1000,d3%1000
d6=distance(d4,d5)
return d6
def __truediv__(self,other):
d1=(self.k*1000)+self.m
d2=(other.k*1000)+other.m
if d1>d2:d3=d1/d2
else:d3=d2/d1
d4,d5 =d3//1000,d3%1000
d6=distance(d4,d5)
return d6
dis1=distance(4,200)
dis2=distance(5,400)
dis1.display()
dis2.display()
dis3=dis1+dis2
dis3.display()
dis4=dis1-dis2
dis4.display()
dis5=dis1*dis2
dis5.display()
dis6=dis1/dis2
dis6.display()
#chef
for i in range(int(input())):
a,b,a1,b1,a2,b2 = map(int,input().split())
if (a==a1 or a==b1) and (b==-a1 or b==b2):
print(1)
elif (a==a2 or a==b2) and (b==a2 or b==b2):
print(2)
else:
print(0)
#create set with defficult level of problem
for t in range (int(input())):
a = list(map(int,input().split()))
b = set(a)
if len(a)==1:
print(0)
elif len(a)==2 and b.count(b[0])!=2:
print(1)
else:
print(2)