{"problem":{"name":"Growth Rate","description":{"content":"Given is a positive integer $M$ and a sequence of $N$ integers: $A = (A_1,A_2,\\ldots,A_N)$. Find the number, modulo $998244353$, of sequences of $N+1$ integers, $X = (X_1,X_2, \\ldots, X_{N+1})$, satis","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":4000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc118_f"},"statements":[{"statement_type":"Markdown","content":"Given is a positive integer $M$ and a sequence of $N$ integers: $A = (A_1,A_2,\\ldots,A_N)$. Find the number, modulo $998244353$, of sequences of $N+1$ integers, $X = (X_1,X_2, \\ldots, X_{N+1})$, satisfying all of the following conditions:\n\n*   $1\\leq X_i\\leq M$ ($1\\leq i\\leq N+1$)\n*   $A_iX_i\\leq X_{i+1}$ ($1\\leq i\\leq N$)\n\n## Constraints\n\n*   $1\\leq N\\leq 1000$\n*   $1\\leq M\\leq 10^{18}$\n*   $1\\leq A_i\\leq 10^9$\n*   $\\prod_{i=1}^N A_i \\leq M$\n\n## Input\n\nInput 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":"arc118_f","tags":[],"sample_group":[["2 10\n2 3","7\n\nSeven sequences below satisfy the conditions.\n\n*   $(1, 2, 6)$, $(1,2,7)$, $(1,2,8)$, $(1,2,9)$, $(1,2,10)$, $(1,3,9)$, $(1,3,10)$"],["2 10\n3 2","9\n\nNine sequences below satisfy the conditions.\n\n*   $(1, 3, 6)$, $(1, 3, 7)$, $(1, 3, 8)$, $(1, 3, 9)$, $(1, 3, 10)$, $(1, 4, 8)$, $(1, 4, 9)$, $(1, 4, 10)$, $(1, 5, 10)$"],["7 1000\n1 2 3 4 3 2 1","225650129"],["5 1000000000000000000\n1 1 1 1 1","307835847"]],"created_at":"2026-03-03 11:01:14"}}