input: Write a function to count the number of pairs in an array that sum up to a given value x.
  def count_pairs(numbers, x):
      count = 0
      i, j = 0, len(numbers) - 1
      while i < j: 
          sum = numbers[i] + numbers[j]
          if sum == x: 
              count += 1
              i += 1
          elif sum < x: 
              i += 1 
          else: 
              j -= 1
      return count
  assert count_pairs([1, 9, 5, 0, 20, -4, 12, 16, 7], 12)==3
  assert count_pairs([1, 2, 3, 4, 5, 6], 7)==3
  assert count_pairs([10, 20, 30, 40, 50], 80)==1
  assert count_pairs([1, 1, 1, 1, 1], 2)==4
  assert count_pairs([], 10)==0
output: def count_pairs(numbers, x):
      count = 0
      i, j = 0, len(numbers) - 1
      while i < j: 
          sum = numbers[i] + numbers[j]
          if sum == x: 
              count += 1
              i += 1
          elif sum < x: 
              i += 1 
          else: 
              j -= 1
      return count