Digit Sums

AtCoder
IDabc101_b
Time2000ms
Memory256MB
Difficulty
Let $S(n)$ denote the sum of the digits in the decimal notation of $n$. For example, $S(101) = 1 + 0 + 1 = 2$. Given an integer $N$, determine if $S(N)$ divides $N$. ## Constraints * $1 \leq N \leq 10^9$ ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
12
Output #1
Yes

In this input, $N=12$. As $S(12) = 1 + 2 = 3$, $S(N)$ divides $N$.
Input #2
101
Output #2
No

As $S(101) = 1 + 0 + 1 = 2$, $S(N)$ does not divide $N$.
Input #3
999999999
Output #3
Yes
API Response (JSON)
{
  "problem": {
    "name": "Digit Sums",
    "description": {
      "content": "Let $S(n)$ denote the sum of the digits in the decimal notation of $n$. For example, $S(101) = 1 + 0 + 1 = 2$. Given an integer $N$, determine if $S(N)$ divides $N$.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc101_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Let $S(n)$ denote the sum of the digits in the decimal notation of $n$. For example, $S(101) = 1 + 0 + 1 = 2$.\nGiven an integer $N$, determine if $S(N)$ divides $N$.\n\n## Constraints\n\n*   $1 \\leq N \\le...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments