https://123dok.net/document/qo513717-longest-minimal-length-partitions.html