using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace YukiCoder { public static class OneAndFive { public static void Main() { List AmountMoney = new List(); string[] Amount = Console.ReadLine().Split(' '); int OneAmount = int.Parse(Amount[0]); int FiveAmount = int.Parse(Amount[1]); for (int One = 1; One <= OneAmount; One++) { AmountMoney.Add(One); } for(int Five = 1; Five <= FiveAmount; Five++) { AmountMoney.Add(Five * 5); } for(int Five = 1; Five <= FiveAmount; Five++) { for (int One = 1; One <= OneAmount; One++) { AmountMoney.Add(One + Five * 5); } } AmountMoney.Sort(); foreach(var Money in AmountMoney.Distinct()) { Console.WriteLine(Money); } Console.ReadKey(); } } }