Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Numerics;
- class QuadronacciRectangle
- {
- static void Main()
- {
- BigInteger n1 = BigInteger.Parse(Console.ReadLine());
- BigInteger n2 = BigInteger.Parse(Console.ReadLine());
- BigInteger n3 = BigInteger.Parse(Console.ReadLine());
- BigInteger n4 = BigInteger.Parse(Console.ReadLine());
- int row = int.Parse(Console.ReadLine());
- int col = int.Parse(Console.ReadLine());
- BigInteger[] m = new BigInteger[row*col+1];
- m[0] = n1;
- m[1] = n2;
- m[2] = n3;
- m[3] = n4;
- for (int j = 3; j <(row*col); j++)
- {
- m[j+1] = m[j] + m[j - 1] + m[j - 2] + m[j - 3];
- }
- int count = 1;
- for (int j=0; j < (col*row); j++)
- {
- Console.Write(m[j]+" ");
- if (j + 1 ==count*col)
- {
- Console.WriteLine();
- count++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment