{"problem":{"name":"AND OR Equation","description":{"content":"You are given positive integers $N$ and $K$. Find the number, modulo $998244353$, of integer sequences $\\bigl(f(0), f(1), \\ldots, f(2^N-1)\\bigr)$ that satisfy all of the following conditions: *   $0\\","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc144_d"},"statements":[{"statement_type":"Markdown","content":"You are given positive integers $N$ and $K$. Find the number, modulo $998244353$, of integer sequences $\\bigl(f(0), f(1), \\ldots, f(2^N-1)\\bigr)$ that satisfy all of the following conditions:\n\n*   $0\\leq f(x)\\leq K$ for all non-negative integers $x$ ($0\\leq x \\leq 2^N-1$).\n*   $f(x) + f(y) = f(x \\,\\mathrm{AND}\\, y) + f(x \\,\\mathrm{OR}\\, y)$ for all non-negative integers $x$ and $y$ ($0\\leq x, y \\leq 2^N-1$)\n\nHere, $\\mathrm{AND}$ and $\\mathrm{OR}$ denote the bitwise AND and OR, respectively.\n\n## Constraints\n\n*   $1\\leq N\\leq 3\\times 10^5$\n*   $1\\leq K\\leq 10^{18}$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$ $K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc144_d","tags":[],"sample_group":[["2 1","6\n\nThe following six integer sequences satisfy the conditions:\n\n*   $(0,0,0,0)$\n*   $(0,1,0,1)$\n*   $(0,0,1,1)$\n*   $(1,0,1,0)$\n*   $(1,1,0,0)$\n*   $(1,1,1,1)$"],["2 2","19"],["100 123456789123456789","34663745"]],"created_at":"2026-03-03 11:01:14"}}