using System.Collections.Generic;
public static void Main()
Func<int, int, int, IEnumerable<double>> f =
(n,t,s)=>Enumerable.Range(1,n+1).Select(x=>(s+new int[t-1].Select(k=>new Random(e).Next(251)).Select((c,i)=>c*Math.Pow(x,i+1)).Sum())%251);
Func<int, int, int, IEnumerable<double>> f2 =
(n,t,s)=>new int[n+1].Select((_,x)=>(s+new int[t-1].Select(k=>new Random(e).Next(251)).Select((c,i)=>c*Math.Pow(x+1,i+1)).Sum())%251);
foreach(var i in f(6,3,230))
foreach(var i in f2(6,3,230))