{"problem":{"name":"The Kth Time Query","description":{"content":"We have a sequence of $N$ numbers: $A = (a_1, a_2, \\dots, a_N)$.   Process the $Q$ queries explained below. *   Query $i$: You are given a pair of integers $(x_i, k_i)$. Let us look at the elements o","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc235_c"},"statements":[{"statement_type":"Markdown","content":"We have a sequence of $N$ numbers: $A = (a_1, a_2, \\dots, a_N)$.  \nProcess the $Q$ queries explained below.\n\n*   Query $i$: You are given a pair of integers $(x_i, k_i)$. Let us look at the elements of $A$ one by one from the beginning: $a_1, a_2, \\dots$ Which element will be the $k_i$\\-th occurrence of the number $x_i$?  \n    Print the index of that element, or $-1$ if there is no such element.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq Q \\leq 2 \\times 10^5$\n*   $0 \\leq a_i \\leq 10^9$ $(1 \\leq i \\leq N)$\n*   $0 \\leq x_i \\leq 10^9$ $(1 \\leq i \\leq Q)$\n*   $1 \\leq k_i \\leq N$ $(1 \\leq i \\leq Q)$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $Q$\n$a_1$ $a_2$ $\\dots$ $a_N$\n$x_1$ $k_1$\n$x_2$ $k_2$\n$\\vdots$\n$x_Q$ $k_Q$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc235_c","tags":[],"sample_group":[["6 8\n1 1 2 3 1 2\n1 1\n1 2\n1 3\n1 4\n2 1\n2 2\n2 3\n4 1","1\n2\n5\n-1\n3\n6\n-1\n-1\n\n$1$ occurs in $A$ at $a_1, a_2, a_5$. Thus, the answers to Query $1$ through $4$ are $1, 2, 5, -1$ in this order."],["3 2\n0 1000000000 999999999\n1000000000 1\n123456789 1","2\n-1"]],"created_at":"2026-03-03 11:01:14"}}