{"problem":{"name":"Subsequence LCM","description":{"content":"You are given a sequence of positive integers $A=(A_1,A_2,\\dots,A_N)$ of length $N$ and a positive integer $M$. Find the number, modulo $998244353$, of non-empty and not necessarily contiguous subsequ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc349_f"},"statements":[{"statement_type":"Markdown","content":"You are given a sequence of positive integers $A=(A_1,A_2,\\dots,A_N)$ of length $N$ and a positive integer $M$. Find the number, modulo $998244353$, of non-empty and not necessarily contiguous subsequences of $A$ such that the least common multiple (LCM) of the elements in the subsequence is $M$. Two subsequences are distinguished if they are taken from different positions in the sequence, even if they coincide as sequences. Also, the LCM of a sequence with a single element is that element itself.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $1 \\leq M \\leq 10^{16}$\n*   $1 \\leq A_i \\leq 10^{16}$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $M$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc349_f","tags":[],"sample_group":[["4 6\n2 3 4 6","5\n\nThe subsequences of $A$ whose elements have an LCM of $6$ are $(2,3),(2,3,6),(2,6),(3,6),(6)$; there are five of them."],["5 349\n1 1 1 1 349","16\n\nNote that even if some subsequences coincide as sequences, they are distinguished if they are taken from different positions."],["16 720720\n1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16","2688"]],"created_at":"2026-03-03 11:01:14"}}