#B4238. Distinct Egyptian Fraction Triplet
Distinct Egyptian Fraction Triplet
Distinct Egyptian Fraction Triplet
Given a positive integer n, find three distinct positive integers x, y, z such that
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