main = getArgs >>= interact . readSolveAndShow . read . head readSolveAndShow v | v >= 0 = showSolution . flip findMinWinSoln v . readStateStats | otherwise = const "Please specify >= 0 target e-c votes\n" readStateStats = map mkStatsEntry . groupsOf 3 . map (filter isAlphaNum) . words