Solver for http://forum.dominionstrategy.com/index.php?topic=12314.0