10287_Esspe-Peasee

2022-5-16 18:16| 发布者: Hocassian| 查看: 64| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504731475100-Problem List-采集的数据-后羿采集器.html

Pro.ID

10287

Title

Esspe-Peasee

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10287

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 10000/5000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    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
    7 9 22
    7 9 32
    0 9 18
    2 5 9
    0 0 0

    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
    7 9 22
    7 9 32
    0 9 18
    2 5 9
    0 0 0

    样例输出

    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!

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部