Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- class MainClass
- {
- public static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int k = int.Parse(Console.ReadLine());
- List<int> result = new List<int>() { 1 };
- for (int i = 1; i < n; i++)
- {
- result.Add(result.Skip(Math.Max(0, result.Count() - k)).Sum());
- }
- Console.WriteLine(String.Join(" ", result));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement