#K15106. Three Distinct Numbers Sum Representation

    ID: 24283 Type: Default 1000ms 256MiB

Three Distinct Numbers Sum Representation

Three Distinct Numbers Sum Representation

You are given a positive integer (N). Your task is to determine whether it is possible to represent (N) as the sum of three distinct positive integers (A), (B), and (C) such that (A < B < C). Formally, you need to find three distinct positive integers satisfying: [ N = A + B + C, \quad A < B < C, ] If such a representation exists, output the three numbers separated by a space. Otherwise, output (-1).

Note: The smallest three distinct positive integers are (1, 2, 3) and their sum is (6). Hence, if (N < 6), no valid representation exists.

inputFormat

The input consists of a single positive integer (N) provided via standard input.

outputFormat

If there exists three distinct positive integers (A), (B), and (C) (with (A < B < C)) such that (A+B+C=N), print them separated by a single space. Otherwise, output (-1). All output should be printed to standard output.## sample

6
1 2 3