import math


def assign(X, Y, centers):
    """Assigns data points to the ceneter geometrically closest to it

    :param X: list of x-values from the data set
    :param Y: list of y-values form the data set
    :param centers: list of (x, y) tuples representing the coordinates of each
                    cluster center
    :returns: list of lists, each sub-list containing the (x, y) coordinates
              assigned to the cluster of that index (i.e. index 0 contains a
              list of coordinates assigned to the first center)
    """
    nearests = [list() for c in centers]
    for (x, y) in zip(X, Y):
        dists = [math.sqrt((x - cx) ** 2 + (y - cy) ** 2) for (cx, cy) in centers]
        index = dists.index(min(dists))
        nearests[index].append((x, y))
    return nearests