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); } }