1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
using System;
using System.Collections.Generic;

class Program {
    static IEnumerable<string> Young2(int n, int m) {
        if (n <= m) yield return new string('□', n) + '\n';

        for (int i = Math.Min(n - 1, m); i > 0; i--)
            foreach (string s in Young2(n - i, i))
                yield return new string('□', i) + '\n' + s;
    }
    static IEnumerable<string> Young(int n) {
        return (n <= 0) ? new string[] {} : Young2(n, n);
    }
    static void Main(string[] args) {
        foreach (string s in Young(50))
            Console.WriteLine(s);
    }   
}