input: from typing import List
  
  def adjust_to_target_median(nums: List[int], target: int) -> int:
      """
      Given an integer list nums and a non-negative integer target, you can modify any element by adding or subtracting 1 per operation.
  
      Calculate the minimum operations required to set the median of nums to target.
  
      The median is the central value of the sorted array, or if there are two medians, the higher value is chosen.
  
      Examples:
      >>> nums = [2,5,6,8,5], target = 4
      2
      >>> nums = [2,5,6,8,5], target = 7
      3
      >>> nums = [1,2,3,4,5,6], target = 4
      0
  
      Constraints:
      1 <= nums.length <= 2 * 10^5
      1 <= nums[i] <= 10^9
      1 <= target <= 10^9
      """
output:     
      nums.sort()
      n = len(nums)
      median_idx = (n - 1) // 2
      median = nums[median_idx]
      
      if median == target:
          return 0
      else:
          return abs(median - target)
  