input: Write a Python function that takes an integer array `nums`, an integer array `queries`, and an integer `x`, and returns a list of integers. For every element in `queries`, find the index of the respective occurrence of `x` in `nums`. If `x` does not occur the required number of times, return -1 for that query.
  
  from typing import List
  
  def locate_occurrences(nums: List[int], queries: List[int], x: int) -> List[int]:
      """
      Given an integer array nums, an integer array queries, and an integer x.
  
      For each element in queries, find the index of the respective occurrence of x in the nums array. If x occurs fewer times than required by queries, return -1 for that query.
  
      Return a list of integers containing the indices corresponding to the queries.
  
      Examples:
      >>> nums = [1, 3, 1, 7], queries = [1, 3, 2, 4], x = 1
      [0, -1, 2, -1]
      >>> nums = [1, 2, 3], queries = [10], x = 5
      [-1]
  
      Constraints:
      1 <= len(nums), len(queries) <= 100000
      1 <= queries[i] <= 100000
      1 <= nums[i], x <= 10000
      """
output: def locate_occurrences(nums: List[int], queries: List[int], x: int) -> List[int]:
      occurrences = [i for i, num in enumerate(nums) if num == x]
      return [occurrences[q - 1] if q <= len(occurrences) else -1 for q in queries]