Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Numerics;
- class Quadronacci
- {
- static void Main()
- {
- BigInteger q1 = new BigInteger(int.Parse(Console.ReadLine()));
- BigInteger q2 = new BigInteger(int.Parse(Console.ReadLine()));
- BigInteger q3 = new BigInteger(int.Parse(Console.ReadLine()));
- BigInteger q4 = new BigInteger(int.Parse(Console.ReadLine()));
- int r = int.Parse(Console.ReadLine());
- int c = int.Parse(Console.ReadLine());
- int cnt = r * c;
- BigInteger[] q = new BigInteger[cnt];
- q[0] = q1; q[1] = q2; q[2] = q3; q[3] = q4;
- for (int i = 4; i < cnt; i++)
- {
- q[i] = q[i-4] + q[i-3] + q[i-2] + q[i-1];
- }
- for (int i = 0; i < r; i++)
- {
- for (int j = 0; j < (c-1); j++)
- {
- Console.Write(q[i*c+j] + " ");
- }
- Console.WriteLine(q[(i+1)*c-1]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment