Pro.ID10287 TitleEsspe-Peasee Title链接http://10.20.2.8/oj/exercise/problem?problem_id=10287 AC0 Submit0 Ratio- 时间&空间限制描述Esspe-Peasee is an ancient game played by children throughout the land of Acmania. The rules are simple: A player simply quibs the yorba at the kwonk. If the yorba hurms the kwonk the player gets a foom. If the yorba hurfs the kwonk the player gets a foob. The objective is to get a twob with as few quibs as possible. Every group of children has its own opinion regarding the value of a foom, the value of a foob, and the value of a twob. However, everyone agrees that a foob is worth more than a foom, and that a twob is worth more than a foob. You may assume that a foom and a foob can each be represented by a 32 bit integer, and a twob can be represented by a 64 bit integer. 输入You will be given a number of game instances to solve. Each instance is specified by 3 non-negative integers that represent the value of a foom, a foob and a twob, respectively. The final line contains three 0's and should not be processed. 输出Description Esspe-Peasee is an ancient game played by children throughout the land of Acmania. The rules are simple: A player simply quibs the yorba at the kwonk. If the yorba hurms the kwonk the player gets a foom. If the yorba hurfs the kwonk the player gets a foob. The objective is to get a twob with as few quibs as possible. Every group of children has its own opinion regarding the value of a foom, the value of a foob, and the value of a twob. However, everyone agrees that a foob is worth more than a foom, and that a twob is worth more than a foob. You may assume that a foom and a foob can each be represented by a 32 bit integer, and a twob can be represented by a 64 bit integer. Input You will be given a number of game instances to solve. Each instance is specified by 3 non-negative integers that represent the value of a foom, a foob and a twob, respectively. The final line contains three 0's and should not be processed. Output For each instance your program should print "A fooms and B foobs for a twob!", on a line by itself as shown in the samples below, where the value of "A" fooms plus "B" foobs add up to a twob, and the sum of "A" and "B" is as small as possible. "fooms" and "foobs" should be appropriately pluralised, as shown in "Output for the Sample Input" below. If there is no such pair you should print out the age-old chant: "Unquibable!" Sample Input 1 6 15 Sample Output 3 fooms and 2 foobs for a twob! Unquibable! 2 fooms and 2 foobs for a twob! 0 fooms and 2 foobs for a twob! 2 fooms and 1 foob for a twob! Source 样例输入1 6 15 样例输出3 fooms and 2 foobs for a twob! Unquibable! 2 fooms and 2 foobs for a twob! 0 fooms and 2 foobs for a twob! 2 fooms and 1 foob for a twob! 作者 |