1777: 【CSP循环-穷举】百钱百鸡问题▅

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

Description

用 lns="http://www.w3.org/1998/Math/MathML">100 元钱买 lns="http://www.w3.org/1998/Math/MathML">100 只鸡,公鸡,母鸡,小鸡都要有。

公鸡 lns="http://www.w3.org/1998/Math/MathML">5 元 lns="http://www.w3.org/1998/Math/MathML">1 只,母鸡 lns="http://www.w3.org/1998/Math/MathML">3 元 lns="http://www.w3.org/1998/Math/MathML">1 只,小鸡 lns="http://www.w3.org/1998/Math/MathML">1 元 lns="http://www.w3.org/1998/Math/MathML">3 只。

请问公鸡,母鸡,小鸡各应该买多少只?

Output

每种买法占一行,由 lns="http://www.w3.org/1998/Math/MathML">3 个数组成,顺序为 公鸡数 母鸡数 小鸡数。每个数字空格隔开。

输出时,按公鸡数从少到多,母鸡数从多到少的顺序输出。

本题符合条件的第一组解为: lns="http://www.w3.org/1998/Math/MathML">4 lns="http://www.w3.org/1998/Math/MathML">18 lns="http://www.w3.org/1998/Math/MathML">78 。这说明每种鸡至少有1只。