input: 
  def kmeans(k: int, data: np.ndarray) -> (np.ndarray, np.ndarray):
      """
      Perform k-means clustering on the given data using the specified number of clusters.
  
      >>> kmeans(3, np.array([[1, 2], [2, 1], [10, 10], [10, 11], [11, 10], [5, 6], [6, 5]]))
      (array([0, 0, 1, 1, 1, 2, 2]), array([[1.5, 1.5], [10.33333333, 10.33333333], [5.5, 5.5]]))
      """
output:     n = data.shape[0]
      centroids = data[np.random.choice(n, k, replace=False)]
      labels = np.zeros(n)
      
      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