Probe request k-th arrival
Your task
A synthetic monitoring service runs a set of probes against one endpoint. Probe i sends its first request at second first_tick[i] and repeats every interval[i] seconds after that, forever. Every request lands on one shared timeline, and two probes that fire in the same second contribute two separate requests. The capacity team needs to know when the k-th request of the whole run happens, counting from the very first one. Return the second at which the k-th request is sent, with k counted from 1. Return -1 when there are no probes at all, since no request is ever sent. first_tick holds non-negative seconds, every interval is at least 1, the two lists have the same length, and k is at least 1.
Examples
kth_probe_tick(first_tick: list[int], interval: list[int], k: int) -> intExample 1
Input
kth_probe_tick([0, 0], [2, 3], 5)Output
4Example 2
Input
kth_probe_tick([5], [10], 3)Output
25Example 3
Input
kth_probe_tick([0, 0, 0], [5, 5, 5], 4)Output
5