{"problem":{"name":"E. xortion","description":{"content":"Hussain doesn't like long statements’ problems, so he will describe his problem in a nutshell.  Hussain will give you an array A[1….N] that consists of N positive integers.  Hussain will ask you Q Q","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":3000,"memory_limit":131072},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10088E"},"statements":[{"statement_type":"Markdown","content":"Hussain doesn't like long statements’ problems, so he will describe his problem in a nutshell. \n\nHussain will give you an array A[1….N] that consists of N positive integers. \n\nHussain will ask you Q Queries each one consists of an integer number X . \n\nHe wants you to find a number P : 1 ≤ P ≤ N such that (A[P]^X  ≥  A[I]^X ) for each (1 ≤ I ≤ N). \n\n^ Refers to “XOR” operation in computer science . \n\nIn case of many possible values of P , take the minimum.\n\nThe first line contains one number T – the number of testcases. \n\nThe second line contains two space-separated numbers, N and Q (1  ≤  N ≤  105, 1  ≤  Q  ≤  3×105) — the size of the array and the number of queries . \n\nThe next line contains N space-separated integers the elements of the array A . All of them will fit into 32 bit signed integer. \n\nNext Q lines contain one integer X (also fits in 32 bit signed integer) which was described above.\n\nFor each testcase output Q lines . The Ith line will contain the answer of the Ith query. \n\nSeparate testcases by a blank line .\n\nUse fast I/O methods\n\n## Input\n\nThe first line contains one number T – the number of testcases. The second line contains two space-separated numbers, N and Q (1  ≤  N ≤  105, 1  ≤  Q  ≤  3×105) — the size of the array and the number of queries . The next line contains N space-separated integers the elements of the array A . All of them will fit into 32 bit signed integer. Next Q lines contain one integer X (also fits in 32 bit signed integer) which was described above.\n\n## Output\n\nFor each testcase output Q lines . The Ith line will contain the answer of the Ith query. Separate testcases by a blank line .\n\n[samples]\n\n## Note\n\nUse fast I/O methods","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ G = (V, E) $ be a directed acyclic graph (DAG), where $ V = \\{1, 2, \\dots, N\\} $ is the set of nodes and $ E \\subseteq V \\times V $ is the set of directed edges ($ |E| = M $).  \nLet $ s = 1 $ be Jorah’s starting node, and $ t = N $ be the target node (Khaleesi’s location).  \n\n**Game Rules**  \n- Players alternate turns, with Jorah moving first.  \n- On Jorah’s turn: he moves along exactly one directed edge from his current node to an adjacent node.  \n- On Khal’s turn: he removes exactly one existing edge from $ E $.  \n- The game ends when:  \n  (i) Jorah reaches node $ N $ → Jorah wins; or  \n  (ii) Jorah is at a node with no outgoing edges → Khal wins.  \n- Both players play optimally.  \n\n**Constraints**  \n1. $ 1 \\le T \\le 10 $  \n2. $ 2 \\le N \\le 100 $, $ 0 \\le M \\le 200 $  \n3. No self-loops or multi-edges.  \n4. $ G $ is acyclic.  \n\n**Objective**  \nDetermine the winner under optimal play:  \n- If Jorah has a strategy to reach node $ N $ regardless of Khal’s edge removals, output \"Jorah Mormont\".  \n- Otherwise, output \"Khal Drogo\".","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10088E","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}