Extract Maximum and Minimum K Elements