def twod_to_oned(size, *coordinates):
    """Converts coordinates (x >= 0, y >= 0) to an int representation.
    :param size: Size of the grid that (x, y) is contained in
    :param coordinates: [(x0, y0), (x1,  y1), ...]
    :return: (int0, int1, ...)
    """
    x_axis = size[0]
    result = tuple(x + y * x_axis for x, y in coordinates)
    if len(result) == 1:
        return result[0]
    return result