using System; using System.Collections.Generic; using System.Linq; namespace StudyApp { class Program { static void Main(string[] args) { string[] inputs = Console.ReadLine().Trim().Split(' '); int oneCoin = int.Parse(inputs[0]); int fiveCoin = int.Parse(inputs[1]); var results = GetCombination(oneCoin, fiveCoin).Distinct().OrderBy(data => data); foreach (var result in results) Console.WriteLine(result); } private static IEnumerable GetCombination(int oneCoin, int fiveCoin) { for (int i = 0; i <= fiveCoin; i++) { for (int j = 0; j <= oneCoin; j++) { int total = i * 5 + j; if (total != 0) yield return total; } } } } }