diff --git a/Hackerrank-Cats and Mouse b/Hackerrank-Cats and Mouse new file mode 100644 index 0000000..22136d9 --- /dev/null +++ b/Hackerrank-Cats and Mouse @@ -0,0 +1,37 @@ +#!/bin/python3 + +import math +import os +import random +import re +import sys + +# Complete the catAndMouse function below. +def catAndMouse(x, y, z): + absCatA, absCatB = abs(x - z), abs(y - z) + if absCatA == absCatB : + return "Mouse C" + elif absCatB > absCatA : + return "Cat A" + else : + return "Cat B" + +if __name__ == '__main__': + fptr = open(os.environ['OUTPUT_PATH'], 'w') + + q = int(input()) + + for q_itr in range(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()