(#), , - . ( ) . , , N. , , "" (10, 2011).
2011 :
- 10 : 2, 4, 5, 80, 80, 80, 160, 320, 640, 640
- 11 : 3, 6, 4, 12, 12, 24, 30, 480, 480, 480, 480
- 13 : 2, 4, 5, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200
- 15 : 3, 6, 6, 12, 16, 16, 32, 32, 32, 64, 256, 256, 256, 512, 512
- , ?
using System;
using System.Collections.Generic;
namespace Recip
{
class Program
{
static void Main(string[] args)
{
int year = 2011;
int numbers = 20;
int[,,] c = new int[year+1, numbers+1, numbers];
List<int> queue = new List<int>();
int num = 1;
do
{
for (int i = 0; i < num; i++)
c[num * num, num, i] = num;
queue.Add(num * num);
num++;
} while (num <= numbers && num * num <= year);
while (queue.Count > 0)
{
int x0 = queue[0];
queue.RemoveAt(0);
for (int i = 0; i <= numbers; i++)
{
if (c[x0, i, 0] > 0)
{
int[] coefs ={ 20, 4, 2, 2, 3, 3};
int[] cons = { 11, 6, 8, 9, 6, 8};
int[] cool = { 3, 2, 2, 2, 2, 2};
int[] k1 = { 2, 2, 4, 3, 3, 2};
int[] k2 = { 4, 4, 4, 6, 3, 6};
int[] k3 = { 5, 0, 0, 0, 0, 0};
int[] mul = { 20, 4, 2, 2, 3, 3};
for (int k = 0; k < 6; k++)
{
int x1 = x0 * coefs[k] + cons[k];
int c1 = i + cool[k];
if (x1 <= year && c1 <= numbers && c[x1, c1, 0] == 0)
{
queue.Add(x1);
c[x1, c1, 0] = k1[k];
c[x1, c1, 1] = k2[k];
int index = 2;
if (k == 0)
{
c[x1, c1, index] = k3[k];
index++;
}
int diff = index;
while (c[x0, i, index - diff] > 0)
{
c[x1, c1, index] = c[x0, i, index - diff] * mul[k];
index++;
}
}
}
}
}
}
for (int n = 1; n < numbers; n++)
{
if (c[year, n, 0] == 0) continue;
int ind = 0;
while (ind < n && c[year, n, ind] > 0)
{
Console.Write(c[year, n, ind] + ", ");
ind++;
}
Console.WriteLine();
}
Console.ReadLine();
}
}
}