#abc101b. B - Digit Sums

B - Digit Sums

Score : 200200 points

问题描述

S(n)S(n) 表示 nn 以十进制表示时各位数字之和。例如,S(101)=1+0+1=2S(101) = 1 + 0 + 1 = 2

给定一个整数 NN,判断 S(N)S(N) 是否能整除 NN

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

Let S(n)S(n) denote the sum of the digits in the decimal notation of nn. For example, S(101)=1+0+1=2S(101) = 1 + 0 + 1 = 2.

Given an integer NN, determine if S(N)S(N) divides NN.

Constraints

  • 1N1091 \leq N \leq 10^9

Input

Input is given from Standard Input in the following format:

NN

Output

If S(N)S(N) divides NN, print Yes; if it does not, print No.

Sample Input 1

12

Sample Output 1

Yes

In this input, N=12N=12. As S(12)=1+2=3S(12) = 1 + 2 = 3, S(N)S(N) divides NN.

Sample Input 2

101

Sample Output 2

No

As S(101)=1+0+1=2S(101) = 1 + 0 + 1 = 2, S(N)S(N) does not divide NN.

Sample Input 3

999999999

Sample Output 3

Yes

update @ 2024/3/10 17:17:25