AtCoder Beginner Contest 080
B
Harshad Number
AtCoder
⌀ 0
原题
← AC →
翻译中…

Problem Statement

翻译中…

An integer $X$ is called a Harshad number if $X$ is divisible by $f(X)$, where $f(X)$ is the sum of the digits in $X$ when written in base $10$.

翻译中…

Given an integer $N$, determine whether it is a Harshad number.

翻译中…

Constraints

翻译中…
  • $1?N?10^8$
  • $N$ is an integer.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N

翻译中…

Output

翻译中…

Print Yes if $N$ is a Harshad number; print No otherwise.

翻译中…

样例

Input #1
12
Output #1
Yes
$f(12)=1+2=3$. Since $12$ is divisible by $3$, $12$ is a Harshad number.
Input #2
57
Output #2
No
$f(57)=5+7=12$. Since $57$ is not divisible by $12$, $12$ is not a Harshad number.
Input #3
148
Output #3
No
题目信息
题号
abc080_b
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。