You are viewing a single comment's thread. Return to all comments →
Bro i am getting run time error on my c# code can you help me with that-
static void Main(string[] args) { int t =Convert.ToInt32(Console.ReadLine()); while(t>0) { string[] data =Console.ReadLine().Split(' '); ulong[] data1 = Array.ConvertAll(data, ulong.Parse); ulong N = data1[0]; ulong M = data1[1]; ulong newM = M - 1; ulong topfact = 1; ulong belowfact1 = 1; ulong belowfact2 = 1; ulong result = 0; for (ulong i=1;i<=(N+ newM);i++) { topfact = topfact * i; if(i<=N) { belowfact1 = (belowfact1 * i); } if (i <= newM) { belowfact2 = belowfact2 * i; } } result = (topfact / (belowfact1 * belowfact2))%1000000007; Console.WriteLine(result); t--; } Console.Read(); }
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Permutations
You are viewing a single comment's thread. Return to all comments →
Bro i am getting run time error on my c# code can you help me with that-