Guest User

IrerativeNK

a guest
Feb 14th, 2021
107
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. class MainClass
  6. {
  7.     public static void Main(string[] args)
  8.     {
  9.         int n = int.Parse(Console.ReadLine());
  10.         int k = int.Parse(Console.ReadLine());
  11.         List<int> result = new List<int>() { 1 };
  12.         for (int i = 1; i < n; i++)
  13.         {
  14.             result.Add(result.Skip(Math.Max(0, result.Count() - k)).Sum());
  15.         }
  16.         Console.WriteLine(String.Join(" ", result));
  17.     }
  18. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×