using System;
public class Program
{
public static bool IsGoodDivision(int a, int b)
{
while (b % 2 == 0) { b /= 2; }
while (b % 5 == 0) { b /= 5; }
return a % b == 0;
}
public static void Test(int a, int b)
{
Console.WriteLine("{0}/{1} {2} good.", a, b, IsGoodDivision(a, b) ? "is" : "is not");
}
public static void Main()
{
Test(1, 4);
Test(1, 8);
Test(47, 183);
Test(58, 889);
Test(1, 5);
}
}
dXNpbmcgU3lzdGVtOwoKcHVibGljIGNsYXNzIFByb2dyYW0KewogICAgcHVibGljIHN0YXRpYyBib29sIElzR29vZERpdmlzaW9uKGludCBhLCBpbnQgYikKICAgIHsKICAgICAgICB3aGlsZSAoYiAlIDIgPT0gMCkgeyBiIC89IDI7IH0KICAgICAgICB3aGlsZSAoYiAlIDUgPT0gMCkgeyBiIC89IDU7IH0KICAgICAgICByZXR1cm4gYSAlIGIgPT0gMDsKICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgVGVzdChpbnQgYSwgaW50IGIpCiAgICB7CiAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoInswfS97MX0gezJ9IGdvb2QuIiwgYSwgYiwgSXNHb29kRGl2aXNpb24oYSwgYikgPyAiaXMiIDogImlzIG5vdCIpOwogICAgfQoKICAgIHB1YmxpYyBzdGF0aWMgdm9pZCBNYWluKCkKICAgIHsKICAgICAgICBUZXN0KDEsIDQpOwogICAgICAgIFRlc3QoMSwgOCk7CiAgICAgICAgVGVzdCg0NywgMTgzKTsKICAgICAgICBUZXN0KDU4LCA4ODkpOwogICAgICAgIFRlc3QoMSwgNSk7CiAgICB9Cn0K