Apply k-map and get the result