{"problem":{"name":"Simple Math 4","description":{"content":"Find the last digit of the remainder when $2^N$ is divided by $2^M - 2^K$. You are given $T$ test cases, each of which must be solved.","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc176_b"},"statements":[{"statement_type":"Markdown","content":"Find the last digit of the remainder when $2^N$ is divided by $2^M - 2^K$.\nYou are given $T$ test cases, each of which must be solved.\n\n## Constraints\n\n*   $1 \\le T \\le 2 \\times 10^5$\n*   $1 \\le N \\le 10^{18}$\n*   $1 \\le K < M \\le 10^{18}$\n*   $N,M,K$ are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format, where $\\mathrm{case}_i$ represents the $i$\\-th test case:\n\n$T$\n$\\mathrm{case}_1$\n$\\mathrm{case}_2$\n$\\vdots$\n$\\mathrm{case}_T$\n\nEach test case is given in the following format:\n\n$N$ $M$ $K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc176_b","tags":[],"sample_group":[["5\n9 6 2\n123 84 50\n95 127 79\n1000000007 998244353 924844033\n473234053352300580 254411431220543632 62658522328486675","2\n8\n8\n8\n4\n\nFor the first test case, the remainder of $2^9$ divided by $2^6 - 2^2$ is $32$. Thus, the answer is the last digit of $32$, which is $2$."]],"created_at":"2026-03-03 11:01:13"}}