Solutions for MaxProductOfTheTree and Triangular tasks