Introduction - If you have any usage issues, please Google them yourself
Background
There was once an cient empire with two different shapes of the two towers at different cities . The two circular brick tower is built piece by piece . These circular brick height is the same, the radius are integers. Clearly, although both towers of different shapes , but making use of the circular tower there are many tiles are identical .
Over many years, a king ordered his architects to remove two brick towers in order to make them part of exactly the same shape , but the height of the two towers as high as possible , and the new order of brick tower must be the same as the original . Kings think this two tower symbolizes the harmony between the two cities and equality , so named them as twin towers.
Task
Now, two years later, you can come to deal with this very simple question : give you a description of two towers of different shapes , as long as you can calculate the new towers built up brick number.
Enter
Inputs include the following: The first line of