#K39682. Equal Sum Group Division

    ID: 26475 Type: Default 1000ms 256MiB

Equal Sum Group Division

Equal Sum Group Division

You are given N employees with unique IDs from 1 to N. Your task is to determine if it is possible to partition these employees into groups of exactly K members in such a way that every group has the same total sum of the employee IDs.

For instance, if employees are numbered consecutively from 1 to N, then a necessary condition for equal sum groups is that N is divisible by K. In fact, if N % K ≠ 0, it is impossible to partition the employees into groups of size K at all. Otherwise, under some assumptions, it might be possible.

Your program should output 1 if such a partition exists, and 0 otherwise.

Note: All input will be read from standard input and output should be printed to standard output.

The mathematical condition can be summarized as: $$ N \equiv 0 \pmod{K} $$

inputFormat

The input consists of two space-separated integers: N and K, where N is the total number of employees, and K is the group size.

outputFormat

Output a single integer: 1 if it is possible to divide the employees into groups satisfying the given conditions, and 0 otherwise.

## sample
6 3
1