using System; using System.Collections.Generic; using System.Linq; public class Test { public static void Main() { int N = 100; List<int> myList = Enumerable.Range(0, N).ToList(); double K = 53; List<int> solutions=new List<int>(); for (int i=1;i<=K;i++) { solutions.Add(myList[(int)Math.Round(i*(N/K)-1)]); } Console.WriteLine(solutions.Count); Console.WriteLine(string.Join(", ", solutions)); } }
Standard input is empty
53 1, 3, 5, 7, 8, 10, 12, 14, 16, 18, 20, 22, 24, 25, 27, 29, 31, 33, 35, 37, 39, 41, 42, 44, 46, 48, 50, 52, 54, 56, 57, 59, 61, 63, 65, 67, 69, 71, 73, 74, 76, 78, 80, 82, 84, 86, 88, 90, 91, 93, 95, 97, 99