Score : 700 points
Given are positive integers N and K.
Determine if the 3N integers K, K+1, ..., K+3N-1 can be partitioned into N triples (a_1,b_1,c_1), ..., (a_N,b_N,c_N) so that the condition below is satisfied. Any of the integers K, K+1, ..., K+3N-1 must appear in exactly one of those triples.
If the answer is yes, construct one such partition.
Input is given from Standard Input in the following format:
N K
If it is impossible to partition the integers satisfying the condition, print -1
. If it is possible, print N triples in the following format:
a_1 b_1 c_1 : a_N b_N c_N
1 1
1 2 3
3 3
-1