# Pastebin qYCqiEaV winners :: Input -> [(Int, Int)] winners Input{..} = catMaybes $ parMap rseq go boards where go Board{_boardNums=[]} = Nothing go !b@Board{_boardNums=(((x,y),n):xs)} = let b' = b & colFill . ix y -~ 1 & rowFill . ix x -~ 1 in if 0 `elem` _colFill b' || 0 `elem` _rowFill b' then Just (n, (drawn IntMap.! n) * sum (((drawn IntMap.!) . snd) <$> xs)) else go b'{_boardNums=xs}