{"problem":{"name":"Digit Sum of 2x","description":{"content":"For a positive integer $x$, let $f(x)$ be the sum of its digit. For example, $f(144) = 1+4+4 = 9$ and $f(1)=1$. You are given a positive integer $N$. Find the following positive integers $M$ and $x$: ","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_a"},"statements":[{"statement_type":"Markdown","content":"For a positive integer $x$, let $f(x)$ be the sum of its digit. For example, $f(144) = 1+4+4 = 9$ and $f(1)=1$.\nYou are given a positive integer $N$. Find the following positive integers $M$ and $x$:\n\n*   The maximum positive integer $M$ for which there exists a positive integer $x$ such that $f(x)=N$ and $f(2x)=M$.\n*   The minimum positive integer $x$ such that $f(x)=N$ and $f(2x)=M$ for the $M$ above.\n\n## Constraints\n\n*   $1\\leq N\\leq 10^5$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc144_a","tags":[],"sample_group":[["3","6\n3\n\nWe can prove that whenever $f(x)=3$, $f(2x) = 6$. Thus, $M=6$. The minimum positive integer $x$ such that $f(x)=3$ and $f(2x)=6$ is $x=3$. These $M$ and $x$ should be printed."],["6","12\n24"],["100","200\n4444444444444444444444444"]],"created_at":"2026-03-03 11:01:14"}}