{"problem":{"name":"D. Wet Shark and Smallest Number","description":{"content":"Today, Wet Shark was given a list of non-necessarily distinct prime integers, a1, a2, ...an. Wet Shark defines k as the smallest integer such that for 1 ≤ i ≤ n, k mod ai = ai - 1. Wet Shark also ha","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10160D"},"statements":[{"statement_type":"Markdown","content":"Today, Wet Shark was given a list of non-necessarily distinct prime integers, a1, a2, ...an.\n\nWet Shark defines k as the smallest integer such that for 1 ≤ i ≤ n, k mod ai = ai - 1.\n\nWet Shark also has an additional integer, o. Tell Wet Shark whether or not k is divisible by o.\n\nThe first line contains one integer, n 1 ≤ n ≤ 100000.\n\nThe second line consists of n space separated integers, the list of primes. Each prime ranges from 2 to 100000.\n\nThe third line consists of the additional integer, o, ranging from 1 to 100000.\n\nIf k is divisible by o, output \"YES\". Else, output \"NO\".\n\n## Input\n\nThe first line contains one integer, n 1 ≤ n ≤ 100000.The second line consists of n space separated integers, the list of primes. Each prime ranges from 2 to 100000.The third line consists of the additional integer, o, ranging from 1 to 100000.\n\n## Output\n\nIf k is divisible by o, output \"YES\". Else, output \"NO\".\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $:  \n- Let $ n_k \\in \\mathbb{Z} $ denote the length of the array.  \n- Let $ A_k = (a_{k,1}, a_{k,2}, \\dots, a_{k,n_k}) $ be a sequence of positive integers.  \n\n**Constraints**  \n1. $ 1 \\le T \\le 64 $  \n2. For each $ k \\in \\{1, \\dots, T\\} $:  \n   - $ 1 \\le n_k \\le 5000 $  \n   - $ 1 \\le a_{k,i} \\le 10^6 $ for all $ i \\in \\{1, \\dots, n_k\\} $  \n3. $ \\sum_{k=1}^{T} n_k \\le 72000 $  \n\n**Objective**  \nCount the number of valid queries $ (l, r) $ with $ 1 \\le l \\le r \\le n_k $ such that in the subarray $ (a_{k,l}, a_{k,l+1}, \\dots, a_{k,r}) $, **exactly one distinct value** occurs an odd number of times, and all other values occur an even number of times.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10160D","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}