This is a CodeShef House and Restaurants problem