Problem:


Score : 200 points

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.

Sample Input 1

12

Sample Output 1

Yes

f(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.

Sample Input 2

57

Sample Output 2

No

f(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.

Sample Input 3

148

Sample Output 3

No



Sample input:
12


Sample output:
Yes

Submission status: Accepted

Solution code:
def sumOfDigits(n):
    ans = 0
    while n > 0:
        ans += n%10
        n = n//10
    return(ans)

import sys
n = int(sys.stdin.readline())
sum = sumOfDigits(n)
if n%sum == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()
wa = 0
for i in range(len(n)):
  wa += int(n[i])
if int(n)%wa:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
n = input()
fx = sum(map(int, n))

if int(n) % fx == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
f=sum(map(int,str(n)))
print("No" if n%f else "Yes")

Submission status: Accepted

Solution code:
sN = input()
N = int(sN)
s = sum(map(int, list(sN)))
if N%s == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
k = N
f = 0
for i in range(9):
    if k == 0:
        break
    else:
        f += k%10
        k = k//10
if N%f == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=str(input());print(['No','Yes'][int(n)%sum([int(i) for i in list(n)])==0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
print('Yes' if N % sum(map(int,list(str(N)))) == 0 else 'No')

Submission status: Accepted

Solution code:
# input()
N = int(input())

# solution
fx = sum([int(e) for e in str(N)])
if N % fx == 0:
    res = 'Yes'
else:
    res = 'No'

# output
print(res)

Submission status: Accepted

Solution code:
import numpy as np
n = input()
base = 0
for c in n:
    base += int(c)

if int(n)%base == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def f(X):
    ans = 0
    while X > 0:
        ans += X % 10
        X //= 10
    return ans

n = int(input())
if n % f(n) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

num = N
fx = 0
while num > 0:
    fx += num % 10
    num //= 10

if N % fx == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
a = n
fx = 0
for i in range(9):
  fx += a%10
  a = a // 10
  
if n%fx == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def digit_sum(n):
  if n <= 0:
    return 0
  return n % 10 + digit_sum(n // 10)

n = int(input())
print("Yes" if n % digit_sum(n) == 0 else "No")

Submission status: Accepted

Solution code:
def main():
    s =input()
    M = sum([int(c) for c in s])
    if int(s) % M == 0:
        return "Yes"
    return "No"

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
n = int(input())
x = n
n_digit_sum = 0
while x > 0:
    n_digit_sum += x%10
    x //= 10
print("Yes" if n%n_digit_sum == 0 else "No")

Submission status: Accepted

Solution code:
n= int(input())

nn = n
f = 0

while nn != 0:#10で割った商が0になったらループ終了
		f +=  int(nn % 10)#一の位(10で割った余り)を加算
		nn = int(nn/10)	#10で割る

if n%f == 0:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
N = int(input())
fn = sum(map(int, list(str(N))))
if N % fn == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())


def sum_digit(n):
    sum_ = 0
    while n != 0:
        sum_ += n % 10
        n //= 10
    return sum_


print("Yes" if N % sum_digit(N) == 0 else "No")

Submission status: Accepted

Solution code:
n=input()
f=sum(map(int,n))
print('Yes' if int(n)%f==0 else 'No')

Submission status: Accepted

Solution code:
N = int(input())
hoge = N
sum = 0

while N >= 1:
    sum += int(N % 10)
    N /= 10

if hoge % sum == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x = input()
fx = sum(map(int, x))
if int(x) % fx == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
strx = input()
x = int(strx)
fx = sum(map(int, list(strx)))
if x % fx == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc080/tasks/abc080_b


def sum_of_digits(x):
    s = str(x)
    return sum(map(int, s))


N = int(input())
if N % sum_of_digits(N) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=input()
n_sum=(sum(map(int,n)))

if int(n) % n_sum == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())
sl = len(str(N))
ts = 0
for j in range(sl):
    t = (N // 10 ** j) % 10
    ts += t
if N % ts == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
print('Yes' if int(n)%sum(map(int,n))==0 else 'No')

Submission status: Accepted

Solution code:
n=int(input())

s=sum([int(i) for i in str(n)])

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

Submission status: Accepted

Solution code:
s = int(input())

result = sum(list(map(int, str(s))))

print("Yes") if s % result == 0 else print("No")

Submission status: Accepted

Solution code:
S = input()
N = int(S)
fn = sum([int(c) for c in S])
print("Yes" if N % fn == 0 else "No")

Submission status: Accepted

Solution code:
n = input() # string で受け取る
sum_n = 0
for i in range(len(n)):
    sum_n += int(n[i])
    
#print(sum_n)
if int(n) % sum_n == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
int_N  = int(N)
y = int_N
s = 0
for i in range(1, 9):
    x= int_N % (10 ** i) / (10 ** (i - 1))
    s += x
    int_N -= int_N % (10 ** i)
    if x == int_N:
        break
if y % s == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=list(input())
fx=0
for i in n:
    fx+=int(i)
nn=int(''.join(n))

if nn%fx==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X=int(input())

f_int=sum([int(x) for x in list(str(X))])

if X%f_int==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()
h = 0
for i in range(len(n)):
    h += int(n[i])

if int(n) % h == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
m = n
sum = 0
while m!= 0:
  sum += m % 10
  m //= 10
if n % sum == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = input()
ans= 0
for i in range(len(N)):
    ans += int(N[i])
print('Yes' if int(N) % ans == 0 else 'No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# input
N = input()

# solve
f = 0
for i in range(len(N)):
    f += int(N[i])

# output
print('Yes' if int(N) % f == 0 else 'No')

Submission status: Accepted

Solution code:
n = input()
d = 0
for i in range(len(n)):
    d += int(n[i])
if int(n) % d == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()
f = sum([int(c) for c in n])
if int(n)%f==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def findSUM(n):
  sum = 0
  while( n > 0 ):
    sum += n % 10
    n //= 10
  return sum

N = int(input())

f = findSUM(N)
if (N % f == 0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = input()
sumN = sum([int(n) for n in N])

print("Yes" if int(N) % sumN == 0 else "No")

Submission status: Accepted

Solution code:
N = int(input())

res = 0
num = N

while num > 0:
    q, mod = divmod(num, 10)
    res += mod
    num = q

if (N % res == 0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())

if n % sum(map(int, list(str(n)))) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
Num = int(input())
check,check1 = 0,Num

while not 0 <= check1 < 1:
    check += check1 % 10
    check1 = int(check1 / 10 )

if (Num % check) == 0 :
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()

X = sum(map(int, N))
print ("Yes" if int(N) % X == 0 else "No")

Submission status: Accepted

Solution code:
N = int(input())

X = sum(int (s) for s in str(N))
print ("Yes" if N % X == 0 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
n_lst = list(map(int, str(n)))
if n % sum(n_lst) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
print("Yes" if int(n)%sum(map(int,n))==0 else "No")

Submission status: Accepted

Solution code:
n = input()
print('Yes' if int(n) % sum(map(int,n)) == 0 else 'No')

Submission status: Accepted

Solution code:
n=int(input())

def sumdigi(x) :
  ans=0
  temp=x
  while(temp>0) :
    #q=temp // 10
    md=temp % 10
    ans+=md
    temp =temp //10
  return ans
#print(sumdigi(834))

if n % sumdigi(n) ==0:
  print("Yes")
else :
  print("No")

Submission status: Accepted

Solution code:
n=int(input())

li=list(str(n))

f=0

for s in li :
  f+=int(s)
if n%f==0 :
  print("Yes")
else :
  print("No")

Submission status: Accepted

Solution code:
N=list(input())
N_ = [int(i) for i in N]
N_sum = sum(N_)
N=int("".join(N))
if N%N_sum==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n= int(input())
s=str(n)
S=0
for i in range(len(s)):
    S+=int(s[i])
print("Yes" if n%S==0 else "No")

Submission status: Accepted

Solution code:
N = int(input())

A = sum([int(a) for a in list(str(N))])

if N % A == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
if n % sum(map(int, str(n))) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
a = int(s)
a = int(s)
sum = 0
for i in s:
    sum += int(i)
if a / sum == int(a / sum):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x = input()
ix = int(x)
lx = 0
xlist = list(x)

for i in range(len(xlist)):
    lx += int(xlist[i])

if ix % lx == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
n_str = list(str(N))
n_list = [int(s) for s in n_str]
f_n = sum(n_list)

if N%f_n == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

n = input()
f = sum(map(int, n))
print('Yes' if int(n) %f == 0 else 'No')

Submission status: Accepted

Solution code:
N=input()
S=sum([int(x) for x in list(N)])
print('Yes') if int(N) % S == 0 else print('No')

Submission status: Accepted

Solution code:
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
N = int(input())
print('Yes') if N % sum(map(int, list(str(N)))) == 0 else print('No')

Submission status: Accepted

Solution code:
n=input()
li = list(n)
m=0
for l in li:
    m=m+int(l)
if int(n)%m==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

if int(s) % sum(int(c) for c in s) == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = input()

s = sum(map(int,list(N)))
if int(N) % s == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = int(input())
print("Yes" if not n % sum(map(int, str(n))) else "No")

Submission status: Accepted

Solution code:
t = input()
n = int(t)

x = list(t)
fx = sum(list(map(int, x)))

if n % fx == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X = input()
x = int(X)
l = len(X)
y = 0
for i in range(l):
  y += int(X[i])
if x % y == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = input()
s = [int(n_) for n_ in n]
print( 'Yes' if int(n) % sum(s) == 0 else 'No' )

Submission status: Accepted

Solution code:
n = input()

s = 0
for i in range(len(n)):
    s += int(n[i])
if int(n)%s == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
x = input()
c = 0
for i in range(len(x)):
  c += int(x[i])
if int(x) % c == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
total = 0
for i in range(len(n)):
    total += int(n[i])
print("Yes" if int(n) % total == 0 else "No")

Submission status: Accepted

Solution code:
N=int(input())

def sumdigit(a):

    ret=0

    while a>0:
        ret+= a%10
        a=a//10
    return ret

sd=sumdigit(N)

if N % sd==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = list(input())

s = 0
for i in n:
    s += int(i)

if int(''.join(n)) % s == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import copy
S = input()
N = int(copy.copy(S))
X = 0
for i in range(len(S)):
  res = S[i]
  X += int(res)
if N % X == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=input()
print( 'Yes' if int(n)%sum(map(int,list(n)))==0 else 'No')

Submission status: Accepted

Solution code:
N = int(input())

def findSumOfDigit(n):
    s = 0
    while(n > 0):
        s += n % 10
        n = int(n / 10)
    return s

if N % findSumOfDigit(N) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
N_keta = len(N)

f_x = 0
for i in range(N_keta):
    f_x += int(N[i])

if int(N) % f_x == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()

sum = 0
for i in range(len(n)):
    sum += int(n[i])
if int(n)%sum == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
fx = 0
for n in N:
    fx += int(n)

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

Submission status: Accepted

Solution code:
n=int(input())
s=str(n)
m=0
for c in s:
  m+=int(c)
if n%m==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
# ABC 80, B - harshard number
n = int(input())

def f(x):
    return(sum([int(i) for i in list(str(x))]))

if n % f(n) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())

N_str=list(str(N))

N_list=[]
for n in N_str:
    N_list.append(int(n))
f_x=sum(N_list)

ans='No'
if N%f_x==0:
    ans='Yes'
    
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from functools import reduce
from operator import add
INF = float("inf")


def yes():
    print("Yes")  # type: str


def no():
    print("No")  # type: str


def solve(N: int):
    if N % reduce(add, [int(c) for c in str(N)]) == 0:
        yes()
    else:
        no()
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
n2 = n
summ = 0
while n > 0:
	mod = n % 10
	summ += mod
	n = n//10
if n2 % summ == 0:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
S = input()
f = sum(int(x) for x in S)
print("Yes" if int(S) % f == 0 else "No")

Submission status: Accepted

Solution code:
n = int(input())
li = list(str(n))
a = sum([int(li[i]) for i in range(len(li))])
print("Yes" if n%a == 0 else "No")

Submission status: Accepted

Solution code:
N = input()

f =sum(list(map(int,list(N))))


if int(N)%f == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()

f =0

for i in range(len(N)):
    f = f + int(N[i])
    
if int(N)%f == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

x = N
f = 0

while x != 0:
    f =f+x%10
    x = x//10
    
if N%f == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
X = 0
for i in range(len(S)):
  X += int(S[i])
if int(S) % X == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

if S%s==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = input()
total = 0

for i in range(len(N)):
    total += int(N[i])

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

Submission status: Accepted

Solution code:
N = input()

fx = sum([int(n) for n in list(N)])
if int(N) % fx == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = int(input())
def findSum(n):
    total = 0
    while (n > 0):
        total += n % 10
        n //= 10
    return total

tmp = findSum(n)
if n % tmp == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X = input()
sum_c = 0
for char in X:
  sum_c += int(char)
if int(X)%sum_c == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())
X = sum([int(i) for i in str(N)])

if N % X == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math

n = int(input())
#a = int(input())
#n,a,b = list(map(int,input().split(" ")))
#ls = list(input().split(" "))
#ls = list(map(int,input().split(" ")))
#a,b = list(input().split())
#string1 = input()
#string2 = input()
#ls = [int(input()) for i in range(n)]

numst = str(n)
num = 0
for i in numst:
  num += int(i)
if n%num == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = input()
s = sum([int(i) for i in n])
if int(n)%s == 0: print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc080/tasks/abc080_b
# B - Harshad Number

n = int(input().split()[0])
n_list = [int(x) for x in str(n)]

answer = 'No'

if n % sum(n_list) == 0:
    answer = 'Yes'

print(answer)

Submission status: Accepted

Solution code:
def SOD(n):
    ans=0
    while n>0:
        ans+=n%10
        n=n//10
    return ans

n=int(input())
print("Yes" if n%SOD(n)==0 else "No")

Submission status: Accepted

Solution code:
N = int(input())
s = 0
n = N
while True:
  s += n%10
  n = n//10
  if n ==0:
    break
if N%s == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    n = int(input())
    N = list(str(n))
    
    tmp = 0
    for i in N:
        tmp += int(i)
        
    if n % tmp == 0:
        print("Yes")
    else:
        print("No")
            	
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
N = int(input())

def sum_10(n):
  ans = 0
  while n != 0:
    ans += n % 10
    n //= 10
  return ans

if N % sum_10(N) == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
#%%
N = int(input())
l = list(str(N))
c=0
for i in range(len(l)):
  c += int(l[i])


if N%c == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = input()
print("Yes") if int(n) % sum([int(c) for c in str(n)]) == 0 else print("No")

Submission status: Accepted

Solution code:
n = input()
num = int(n)
n = [int(i) for i in list(n)]
print('Yes') if num / sum(n) == int(num / sum(n)) else print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

def main():
    NS = input()
    N = list(NS.strip())
    fx = 0
    for i in N:
        fx += int(i)

    n = int(NS)
    print("Yes" if n % fx == 0 else "No")



main()

Submission status: Accepted

Solution code:
a = input()
b = 0
for i in range(len(a)):
    b += int(a[i])
print("Yes"if int(a) % b == 0 else "No")

Submission status: Accepted

Solution code:
N = int(input())
n = N
fx = 0
while(n>0):
    fx += n % 10
    n //= 10
if(N % fx == 0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x = input()
fx = 0
for i in x:
    fx += int(i)
if int(x) % fx == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# ABC080-B
N = input()
l = len(N)
fn = 0
for i in range(l):
    fn += int(N[i])
if int(N) % fn == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())
print('YNeos'[n%sum(list(map(int,str(n))))!=0::2])

Submission status: Accepted

Solution code:
def harshad(x):
    sum = 0
    for n in str(x):
        sum += int(n)
    if x % sum == 0:
        return "Yes"
    else:
        return "No"
print(harshad(int(input())))

Submission status: Accepted

Solution code:
N = int(input())
NN = N
fN = 0
while NN > 0:
  fN += NN % 10
  NN //= 10

if N % fN == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a = input()
b = list(a)
c = sum(int(b[i])for i in range(len(b)))
print("Yes" if int(a) % c == 0 else "No")

Submission status: Accepted

Solution code:
n = int(input())
total = 0
s = n

while s > 0:
    total += s % 10
    s //= 10

if n % total == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = list(input())
x = sum([int(i) for i in n])
y = int(''.join(n))
ans = 'No'
if y % x == 0:
    ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

num = N
s = 0
while num != 0:
    s += num % 10  # 1の位を加算
    num = num // 10  # 位を右にシフト ex. 234 -> 23

if N % s == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
num = input()
x = 0

for i in range(len(num)):
  x += int(num[i])
if int(num)%x == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
inp = input()
nn = int(inp)
n = list(inp)
n = list(map(int,n))
if nn%sum(n) == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=input()
nn=[_ for _ in n]
nnn=sum([int(_) for _ in nn])
if int(n)%nnn==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = input()

    fn = 0
    for i in range(len(N)):
        fn += int(N[i])

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

Submission status: Accepted

Solution code:
a=str(input())
b=0
for i in a:
  b+=int(i)

if int(a)%b==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def harshad(n):
    s = 0
    n = str(n)
    for i in n:
        s += int(i)
    return s

n = int(input())

if n % harshad(n) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
n = N
x = 0
while n:
    x += n%10
    n = n//10
if N%x==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = int(S)
sum = 0
for i in range(0, len(S)):
	sum += int(S[i])
if N % sum == 0:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
n=int(input())
f_n=0
for i in range(len(str(n))):
    f_n+=int(str(n)[i])
if n%f_n==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

sum_n = 0
for i in range(len(str(n))):
    sum_n += int(str(n)[i])

if n % sum_n == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = int(input())
n1 = sum(map(int, str(n)))
print("Yes" if n % n1 == 0 else "No")

Submission status: Accepted

Solution code:
n = int(input())
l = list(str(n))
s = sum([int(i) for i in l])
if n%s==0:print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
n = int(input())

m = n
f = 0
while m > 0:
    f += m % 10
    m = m // 10

if n % f == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=int(input())
def f(n):
    n=str(n)
    r=0
    for i in range(len(n)):
        r+=int(n[i])
    return r
if n%f(n)==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()
li = list(n)


nx = sum([int(li[i]) for i in range(len(li))])

ans = ["No","Yes"]

print(ans[int(n)%nx==0])

Submission status: Accepted

Solution code:
n = input()
f_n =sum( [int(x) for x in n])

if int(n) % f_n:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
# coding: utf-8
import time
import re
import math
import fractions

def main():
    X=int(input())
    S=str(X)
    total=0
    for a in range(len(S)):
        total+=int(S[a])
    if X%total==0:
        print("Yes")
    else:
        print("No")


start=time.time()
main()
#print("処理速度 {}sec".format(time.time()-start))
#A=list(map(int,input().split()))
#A,B,C=map(int,input().split())
#n=int(input())

Submission status: Accepted

Solution code:
n = input()
s = 0
for i in range(len(n)):
        s += int(n[i])
print("Yes" if int(n)%s == 0 else "No")

Submission status: Accepted

Solution code:
N = int(input())
if N % sum([int(i) for i in str(N)]) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n_str = input()

total = sum([int(num_str) for num_str in n_str])

if int(n_str) % total == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3


def read_h(typ=int):
    return map(typ, input().split())


def read_v(n, typ=int):
    return [typ(input()) for _ in range(n)]


def main():
    n = input()
    s = sum([int(d) for d in n])

    if int(n) % s == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
c=0
num=n
for i in range(10):
    c=c+n%10
    n=n//10
    #print(n)
    #print(c)
if (num%c==0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a = int(input())
b = list(str(a))
c = list(map(int,b))
d = sum(c)

if a%d==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = input()
print('Yes' if int(n) % sum(map(int, n)) == 0 else 'No')

Submission status: Accepted

Solution code:
N = input()
f_X = sum([int(x) for x in list(N)])
X = int(N)

print('Yes' if X % f_X == 0 else 'No')

Submission status: Accepted

Solution code:
N = int(input())

S = str(N)
f = 0
for s in S:
    f += int(s)

if N % f == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=input()
c=0
for i in n:
  c+=int(i)
print("YNeos"[int(n)%c!=0::2])

Submission status: Accepted

Solution code:
N = int(input())
N_copy = N
order =[]
while True:
    order.append(N % 10)
    N = int(N/10)
    if N == 0:
        break
if N_copy % sum(order) == 0:
    print("Yes") 
else:
    print("No")

Submission status: Accepted

Solution code:
n=input()
i=int(n)
m=sum(list(map(int,list(n))))
print('Yes' if i%m==0 else 'No')

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = input()
N_int = int(N)
N_li = list(map(int, list(N)))

if N_int % sum(N_li) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()
total = 0
for c in n:
    total += int(c)
if int(n)%total==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=input()
sum=0
for i in range(len(n)):
    sum+=int(n[i])
n=int(n)
print("Yes" if n%sum==0 else "No")

Submission status: Accepted

Solution code:
n=int(input())
sn=[int(i) for i in str(n)]
print("Yes" if n%sum(sn)==0 else "No")

Submission status: Accepted

Solution code:
n = input()
nn = sum(list(map(int,n)))
if int(n)%nn == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()

tmp = []
for i in range(len(N)):
    tmp.append(int(N[i]))

f = sum(tmp)

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

Submission status: Accepted

Solution code:
N=int(input())
n=str(N)
sum=0
for i in range(len(n)):
  sum+=int(n[i])

if N%sum==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
a=n
s=0
while(a >= 1):
  s+=a%10
  a=a//10
if n%s==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = input()
N = list(n)
sum = 0
for i in range(len(N)):
  sum += int(N[i])
  
if int(n) % sum == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n =int(input())
dn = n
total = 0
while dn > 0:
  total += dn % 10
  dn //= 10
if n%total ==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
Inp = input()
Inp_list = list(Inp) 

F_x = 0
for i in Inp_list: F_x += int(i)

if int(Inp) % F_x == 0: print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
Inp = input()
Inp_list = list(Inp) 

F_x = 0
for i in Inp_list: F_x += int(i)

if int(Inp) % F_x == 0: print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
N=input()
q=0
for i in N:
    q+=int(i)
print(["No","Yes"][int(N)%q==0])

Submission status: Accepted

Solution code:
n = int(input())

def h(x):
    y = 0
    while x > 0:
        y += x%10
        x = x//10
    return y

if n % h(n) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=int(input())

s=str(n)
num=[]

for i in range(len(s)):
    num.append(int(s[i]))

s=sum(num)

if n%s==0:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
n=input();print(["No","Yes"][int(n)%sum([int(i) for i in n])<1])

Submission status: Accepted

Solution code:
n = input()
sums = 0
for i in range(len(n)):
    sums += int(n[i])
if int(n) % sums == 0:
    print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
n = input()
N = int(n)
X = 0
for nn in n:
    X += int(nn)
if N%X == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def sumdig(r):
    c = 0
    while r:
        c += r % 10
        r //= 10
    return c


n = int(input())
if n % sumdig(n) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = s()

total = 0
for c in N:
    total += int(c)

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

Submission status: Accepted

Solution code:
n = int(input())
num = n
f = 0
while n > 0:
    f += n % 10
    n = n // 10

if(num % f == 0):
    print('Yes')
else:
    print('No')