def read_data(filename):
    """ read the cities data ffrom txt file and store them as a list of tuples of (x, y) """
    cities = []
    with open(filename) as f:
        lines = f.readlines()
        n = int(lines[0].split()[0])
        for line in lines[1:]:
            cities.append((float(line.split()[0]), float(line.split()[1])))

    return cities, n