We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
importmathimportosimportrandomimportreimportsys# Complete the catAndMouse function below.defcatAndMouse(x,y,z):ifabs(x-z)<abs(y-z):return'CatA'elifabs(x-z)>abs(y-z):return'CatB'else:return'MouseC'if__name__=='__main__':fptr=open(os.environ['OUTPUT_PATH'],'w')q=int(input())forq_itrinrange(q):xyz=input().split()x=int(xyz[0])y=int(xyz[1])z=int(xyz[2])result=catAndMouse(x,y,z)fptr.write(result+'\n')fptr.close()
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Cats and a Mouse
You are viewing a single comment's thread. Return to all comments →
Python