1783: 【CSP循环-穷举】怎样种树?█

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:5 Solved:3

Description

公园准备在小山上种桃树、梨树、苹果树,为了美观,总共准备种 lns="http://www.w3.org/1998/Math/MathML">n 棵树( lns="http://www.w3.org/1998/Math/MathML">n6 且 lns="http://www.w3.org/1998/Math/MathML">n 一定是 lns="http://www.w3.org/1998/Math/MathML">6 的倍数),要求三种树都得有,且每种树的数量都得是偶数,桃树的数量不能比梨树的数量多,梨树的数量不能比苹果树的数量多。

请问有这三种树的数量分别有哪些可能的组合方法,从少到多分别数出桃树、梨树、苹果数可能的数量组合,每行 lns="http://www.w3.org/1998/Math/MathML">1 个方案。

Input

一个整数 lns="http://www.w3.org/1998/Math/MathML">n 。( lns="http://www.w3.org/1998/Math/MathML">n6 且是 lns="http://www.w3.org/1998/Math/MathML">6 的倍数)

Output

若干行的可能的组合方案,每行 lns="http://www.w3.org/1998/Math/MathML">3 个数,分别代表桃树、梨树、苹果树的可能的方案。

Sample Input Copy

12

Sample Output Copy

2 2 8
2 4 6
4 4 4