• [1578] The smart Big Pang Pang(sorry已修改)

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Today,Big Pang Pang and Captain want to plan a game,the rule is simple.Now,they starting with two natural numbers.Captain,the first player, subtracts any positive multiple of the lesser of the two numbers from the greater of the two numbers, provided that the resulting number must be nonnegative. Then Big Pang Pang, the second player, does the same with the two resulting numbers, then Captain, etc., alternately, until one player is able to subtract a multiple of the lesser number from the greater to reach 0, and thereby wins. For example, the players may start with (25,7):

    25 7
    11 7
    4 7
    4 3
    1 3
    1 0

    an Captain wins.
    (sorry,数据已经修改。

  • 输入
  • The input consists of a number of lines. Each line contains two positive integers giving the starting two numbers of the game. Captain always starts.
  • 输出
  • For each line of input, output one line saying either Captain or Big Pang Pang assuming that both of them play perfectly. The last line of input contains two zeroes and should not be processed.
  • 样例输入
  • 34 12
    15 24
    0 0
  • 样例输出
  • Captain
    Big Pang Pang
    
  • 提示
  • 来源
  • 本站或者转载
  • 操作

显示春菜