Guest User

Untitled

a guest
Oct 6th, 2017
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. class Program
  5. {
  6. private static void Main()
  7. {
  8. var n = int.Parse(Console.ReadLine());
  9. var k = int.Parse(Console.ReadLine());
  10. var array = new long [n];
  11. array[0] = 1;
  12. for (var i = 0; i < array.Length; i++)
  13. {
  14. array[i] += array.Reverse().Skip(array.Length - i).Take(k).Sum();
  15. Console.WriteLine(array[i]);
  16. }
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment