input: from typing import List, Tuple
  import numpy as np
  
  def kmeans(k: int, data: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
      """
      Perform k-means clustering on data
      >>> kmeans(2, np.array([[1.0, 1.0], [2.0, 2.0], [10.0, 10.0], [11.0, 11.0]]))
      (array([0, 0, 1, 1]), array([[1.5, 1.5], [10.5, 10.5]]))
      >>> kmeans(3, np.array([[1.0, 1.0], [2.0, 2.0], [10.0, 10.0], [11.0, 11.0], [5.0, 5.0]]))
      (array([0, 0, 1, 1, 2]), array([[1.5, 1.5], [10.5, 10.5], [5.0, 5.0]]))
      """
output:     n_samples, n_features = data.shape
      centroids = data[np.random.choice(n_samples, k, replace=False)]
      labels = np.zeros(n_samples)
      
      while True:
          distances = np.linalg.norm(data[:, np.newaxis] - centroids, axis=2)
          new_labels = np.argmin(distances, axis=1)
          
          if np.array_equal(labels, new_labels):
              break
          
          labels = new_labels
          for i in range(k):
              centroids[i] = np.mean(data[labels == i], axis=0)
      
      return labels, centroids