#K77267. Harmonious Sequence

    ID: 34827 Type: Default 1000ms 256MiB

Harmonious Sequence

Harmonious Sequence

You are given three integers \(N\), \(k\), and \(m\). Consider the sequence defined by:

\(a_i = (i \times k) \bmod m, \quad 0 \le i \lt N\)

The sequence is called harmonious if all generated notes are distinct. Otherwise, it is not harmonious.

Your task is to determine whether the sequence is harmonious.

Input: Three integers \(N\), \(k\), and \(m\).

Output: Print True if the sequence is harmonious; otherwise, print False.

inputFormat

Input is read from standard input. It consists of three space-separated integers: N, k, and m.

outputFormat

Output to standard output a single string, either "True" or "False", indicating whether the sequence is harmonious.## sample

4 3 5
True