#K56312. Minimal Absolute Difference

    ID: 30171 Type: Default 1000ms 256MiB

Minimal Absolute Difference

Minimal Absolute Difference

Given N employee IDs labeled from 1 to N, split them into two non-empty groups such that the absolute difference between the sum of IDs in the two groups is minimized.

Let \( S = \{1,2,\dots,N\} \) be the set of employee IDs. You are required to partition \( S \) into two non-empty subsets \( A \) and \( B \). Define \( a = \sum_{x \in A} x \) and \( b = \sum_{x \in B} x \). Your task is to compute the minimum possible value of \( |a-b| \).

Note: For the case when \( N = 1 \), even though a nonempty partition into two groups is not possible in a conventional sense, by definition the output is set to \( 1 \).

inputFormat

The input consists of a single integer (N) (where (1 \leq N)) representing the number of employee IDs. The input is provided through standard input (stdin).

outputFormat

Output the minimum absolute difference between the sums of the two groups on standard output (stdout).## sample

6
1

</p>