This problem reflects a key strategy when dealing with discrete problem space - split split split..
That' is to say, we check each house and find its closest heater.. luckily, houses are independent with each other.