public static class Program
public static int posCnt = 7;
public static int vecLen = 3;
static int[] VecFirstpos;
public static void Main()
vecCnt = posCnt / vecLen;
VecFirstpos = new int[vecCnt];
VecLastpos = new int[vecCnt];
static void ArrangeVectors(int idx, int pos)
VecLastpos[idx] = pos + vecLen - 1;
for (int l = pos; l <= posCnt - (vecCnt - idx) * vecLen; l++)
ArrangeVectors(nextIdx, VecLastpos[idx] + l + 1);
for (int k = VecFirstpos[idx]; k < posCnt - vecLen + 1; k++)
VecLastpos[idx] = VecFirstpos[idx] + vecLen - 1;
static void PrintArrangement()
for (int i = 0; i < posCnt; i++)
for (int j = 0; j < vecCnt; j++)
if ((VecFirstpos[j] <= i) && (i <= VecLastpos[j]))