using System.Collections.Generic;
public static void Main()
int[] a = {1, 3, 4, 6, 7, 12};
foreach (var b in a.QuickPerm())
decimal x = (decimal)(c[0]) / (decimal)(c[1]);
decimal y = (decimal)(c[2]) / (decimal)(c[3]);
decimal z = (decimal)(c[4]) / (decimal)(c[5]);
if (Math.Round(x, 2) + Math.Round(y, 2) == Math.Round(z, 2))
Console.WriteLine("{0} {1} {2} {3}", x, y, z, String.Join(", ", b));
Console.WriteLine("Hello World");
public static class Extensions
public static IEnumerable<IEnumerable<T>> QuickPerm<T>(this IEnumerable<T> set)
List<T> list = new List<T>(set);
for (int x = 0; x < N; x++)
yieldRet[x] = list[a[x] - 1];