atcoder#NIKKEI20192QUALE. Non-triangular Triplets
Non-triangular Triplets
Score : points
Problem Statement
Given are positive integers and .
Determine if the integers can be partitioned into triples so that the condition below is satisfied. Any of the integers must appear in exactly one of those triples.
- For every integer from to , holds.
If the answer is yes, construct one such partition.
Constraints
Input
Input is given from Standard Input in the following format:
Output
If it is impossible to partition the integers satisfying the condition, print -1
. If it is possible, print triples in the following format:
1 1
1 2 3
3 3
-1