Examples
Input: ([[1,1],[2,2],[2,2],[1,1],[2,2],[3,3]], 2)
Expected Output: [[2, 2], [1, 1]]
Explanation: Point [2,2] appears 3 times and [1,1] appears 2 times, so they are the top 2 distinct points.
Input: ([[1,2],[0,2],[1,2],[2,1],[0,2],[2,1],[3,0]], 3)
Expected Output: [[0, 2], [1, 2], [2, 1]]
Explanation: The points [0,2], [1,2], and [2,1] each appear twice. Their squared distances are 4, 5, and 5, so [0,2] comes first. Between [1,2] and [2,1], x is smaller for [1,2].
Input: ([[-1,0],[0,-1],[-1,0],[0,-1],[1,0]], 2)
Expected Output: [[-1, 0], [0, -1]]
Explanation: [-1,0] and [0,-1] both appear twice and both have squared distance 1. Since x is smaller for [-1,0], it comes first.
Input: ([[5,-5],[5,-5],[5,-5]], 1)
Expected Output: [[5, -5]]
Explanation: There is only one distinct point, so it must be returned.
Input: ([[1,1],[-1,1],[1,-1],[-1,-1]], 3)
Expected Output: [[-1, -1], [-1, 1], [1, -1]]
Explanation: All points appear once and all have the same squared distance 2, so ordering is determined by x first, then y.