Repunit Trio

AtCoder
IDabc333_c
Time2000ms
Memory256MB
Difficulty
A repunit is an integer whose digits are all $1$ in decimal representation. The repunits in ascending order are $1, 11, 111, \ldots$. Find the $N$\-th smallest integer that can be expressed as the sum of exactly three repunits. ## Constraints * $N$ is an integer between $1$ and $333$, inclusive. ## Input The input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
5
Output #1
113

The integers that can be expressed as the sum of exactly three repunits are $3, 13, 23, 33, 113, \ldots$ in ascending order. For example, $113$ can be expressed as $113 = 1 + 1 + 111$.
Note that the three repunits do not have to be distinct.
Input #2
19
Output #2
2333
Input #3
333
Output #3
112222222233
API Response (JSON)
{
  "problem": {
    "name": "Repunit Trio",
    "description": {
      "content": "A repunit is an integer whose digits are all $1$ in decimal representation. The repunits in ascending order are $1, 11, 111, \\ldots$. Find the $N$\\-th smallest integer that can be expressed as the sum",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc333_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "A repunit is an integer whose digits are all $1$ in decimal representation. The repunits in ascending order are $1, 11, 111, \\ldots$.\nFind the $N$\\-th smallest integer that can be expressed as the sum...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments