Not clear. Here is my code:
using System;<br />
using System.Collections.Generic;<br />
<br />
class CoveringCuboid<br />
{<br />
static void Main()<br />
{<br />
List<List<ulong>>[] Lst = new List<List<ulong>>[20000];<br />
DateTime StartTime = DateTime.Now;<br />
<br />
ulong Limit = 20000;<br />
ulong[] LayerArray = new ulong[Limit + 1];<br />
<br />
for (ulong X = 1; NumberOfBlock(X,X,X,1)<=Limit; X++)<br />
{<br />
for (ulong Y = X; NumberOfBlock(X, Y, Y, 1) <= Limit; Y++)<br />
{<br />
for (ulong Z = Y; NumberOfBlock(X, Y, Z, 1) <= Limit; Z++)<br />
{<br />
for (ulong Layer = 1; NumberOfBlock(X, Y, Z, Layer) <= Limit; Layer++)<br />
{<br />
LayerArray[NumberOfBlock(X, Y, Z, Layer)]++;<br />
}<br />
}<br />
}<br />
}<br />
<br />
Console.WriteLine("\n Result : " + Array.IndexOf<ulong>(LayerArray, 1000));<br />
<br />
DateTime EndTime = DateTime.Now;<br />
<br />
TimeSpan ExecutionTime = EndTime - StartTime;<br />
<br />
Console.WriteLine("\n Total Execution Time : {0} millisec.\n", ExecutionTime.TotalMilliseconds);<br />
<br />
var a = Lst[1000];<br />
<br />
foreach (var b in a)<br />
{<br />
foreach (var c in b)<br />
{<br />
Console.Write(c);<br />
<br />
}<br />
Console.WriteLine();<br />
}<br />
}<br />
<br />
static ulong NumberOfBlock(ulong X, ulong Y, ulong Z, ulong Layer)<br />
{ <br />
return 4 * (X + Y + Z + Layer - 2) * (Layer - 1) + 2 * (X * Y + X * Z + Y * Z);<br />
}<br />
}