Company: amazon_23april
Difficulty: medium
Tiling Cost Bob has bought a complete basement for remodeling. He wants to tile its entire floor which is X units in length and Y units in breadth. He has a mathematical function f(X,Y) to find the cost for the flooring: f(X,Y) = X * f(X-2,Y-2) if X > 2 and Y > 2 f(X,Y) = X * Y * h(X,Y) if X ≤ 2 or Y ≤ 2 f(X,Y) = 1 if X ≤ 0 or Y ≤ 0 where h(X,Y) = (2*X + 3*Y + 5) Input Specification input1 : An integer value X, representing the length of the floor to be tiled. input2 : An integer value Y, representing the breadth of the floor to be tiled. Output Specification Return an integer value representing the total cost of tiling the floor using mathematical function f(X,Y). Examples Example 1: input1: 3 input2: 5 Output: 360 Here we are given the length of the basement X = 3 and the breadth of the basement Y = 5. The cost of tiling the basement will be: f(X,Y) = f(X-2,Y-2) + (2X + 2Y - 4) * h(X,Y) f(3,5) = f(1,3) + (2*3 + 2*5 - 4) * h(3,5) where h(3,5) = 2*3 + 3*5 + 5 = 26 f(3,5) = (1 * 3) * h(