• + 3 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();
            }