#K91317. Harshad Number Check

    ID: 37949 Type: Default 1000ms 256MiB

Harshad Number Check

Harshad Number Check

A positive integer n is said to be a Harshad number (or Niven number) if it is divisible by the sum of its digits. In mathematical notation, a number \( n \) is a Harshad number if \[ n \bmod \Big( \sum_{d \in digits(n)} d \Big) = 0. \]

Your task is to write a program that reads an integer from standard input (stdin) and prints "True" to standard output (stdout) if the number is a Harshad number, or "False" otherwise.

For example, if the input is 18, the sum of the digits is 1 + 8 = 9 and since \(18 \bmod 9 = 0\), the output should be "True".

inputFormat

The input consists of a single integer ( n ) provided via standard input (stdin).

outputFormat

Output a single line containing either "True" or "False". Output "True" if ( n ) is a Harshad number, otherwise output "False".## sample

18
True