Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class LeastMajorityMultiple
- {
- static void Main()
- {
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- int c = int.Parse(Console.ReadLine());
- int d = int.Parse(Console.ReadLine());
- int e = int.Parse(Console.ReadLine());
- int i = 1;
- for (i = 1; i <= 1000000000; i++)
- {
- int count = 0;
- if (i % a == 0)
- {
- count++;
- }
- if (i % b == 0)
- {
- count++;
- }
- if (i % c == 0)
- {
- count++;
- }
- if (i % d == 0)
- {
- count++;
- }
- if (i % e == 0)
- {
- count++;
- }
- if (count > 2)
- {
- break;
- }
- }
- Console.WriteLine(i);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement