input: Write a Python function named locate_occurrences that takes an integer list nums, an integer list queries, and an integer x. The function should return a list of integers where each element is the index of the queries[i]_th occurrence of x in the nums array. If the occurrences are fewer than queries[i], return -1 for that query.
output: 
  def locate_occurrences(nums, queries, x):
      result = []
      occurrences = []
      for index, value in enumerate(nums):
          if value == x:
              occurrences.append(index)
      for q in queries:
          if q <= len(occurrences):
              result.append(occurrences[q - 1])
          else:
              result.append(-1)
      return result
  