Problem:


Score : 200 points

Problem Statement

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

Output

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

Sample Input 1

12

Sample Output 1

Yes

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

Sample Input 2

101

Sample Output 2

No

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

Sample Input 3

999999999

Sample Output 3

Yes



Sample input:
12


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
def S(a):
    c = 0
    while a != 1:
        if a%2 == 1:
            c += 1
        a = a//2
    c += 1
    return c

N = int(input())
if N%S(N) == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
n=input()
s=0
n=str(n)
for i in n:
    s+=int(i)
if int(n)%s==0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
n = input()
x = 0
for i in n:
    x += int(i)
if int(n) % x:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
n=int(input())
n=str(n)
s=0
for i in n:
    s+=int(i)
if (int(n)%s==0):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
n = int(input())
s = sum(map(int, list(str(n))))

if n % s:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a = int(input())
b = sum(list(map(int,list(str(a)))))
ans = a%b
print(ans)
print("Yes" if ans == 0 else"No")

Submission status: Wrong Answer

Solution code:
import sys
import math

def input():
    return sys.stdin.readline().rstrip()

def euc(a,b):

    while b!=0:
        a,b =b,a%b

    return a

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append(i)

    if temp != 1:
        arr.append(temp)

    if arr == []:
        arr.append(n)
    return arr

def sieve_of_erastosthenes(num):
    input_list = [False if i % 2 == 0 else True for i in range(num)]
    input_list[0] = input_list[1] = False
    input_list[2] = True
    sqrt = int(math.sqrt(num))+1

    for serial in range(3, num, 2):

        if input_list[serial]==False:
            continue

        if serial >= sqrt:
            return input_list

        for s in range(serial ** 2, num, serial*2):
            input_list[s] = False


def main():
    N = input()
    n = int(N)
    s = 0

    while n:
        s += n % 10
        n = n // 10
    if int(N) % 2 == 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()