import numpy as np


def summarize(sentences, num_sentences):

    centroid = np.array([s['vector'] for s in sentences]).mean(0)

    distances_to_centroid = [np.linalg.norm(np.array(s['vector']) - np.array(centroid)) for s in sentences]
    sorted_indices = sorted(list(range(len(sentences))), key=lambda i: distances_to_centroid[i])
    sorted_sentences = [sentences[i]['text'] for i in sorted_indices]

    return sorted_sentences[:num_sentences]