#B4238. Distinct Egyptian Fraction Triplet

    ID: 11895 Type: Default 1000ms 256MiB

Distinct Egyptian Fraction Triplet

Distinct Egyptian Fraction Triplet

Given a positive integer n, find three distinct positive integers x, y, z such that

1x+1y+1z=2n,\frac{1}{x}+\frac{1}{y}+\frac{1}{z}=\frac{2}{n},

holds. If no such triple exists, output -1. A valid solution for n > 1 is:

  • x = n
  • y = n+1
  • z = n*(n+1)

Note that when n = 1 the triple (1, 2, 2) would not be distinct, hence print -1 in that case.

inputFormat

The input consists of a single positive integer n (n is guaranteed to be positive). You can assume that for n > 1 a solution exists.

outputFormat

If a valid triple exists, output three distinct positive integers x, y, z separated by spaces. Otherwise, output -1.

sample

2
2 3 6