Types: X: int, K: int, r: List[int], Q: int, t: List[int], a: List[int]

Ranges: 1 ≤ X ≤ 10^9, 1 ≤ K ≤ 10^5, 1 ≤ r_i ≤ 10^9, 1 ≤ Q ≤ 10^5, 0 ≤ t_i ≤ 10^9, 0 ≤ a_i ≤ X

Addtl Info: All input values are integers.