Let the number of sides of the polygons be and , then the first condition tell you that:

,

and as the interior angle of a ploygon with sides is , the second condition tells us that:

which may be simplified as we know to:

Now we can proceed to solve and , or we can just guess, when we find , .

RonL