Find the smallest subnet for a given list of IP addresses.