• [B] Blitzcrank

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Blitzcrank is a robot.

    There are some pretty good registers(寄存器) in Blitzcrank's body.

    There are some instructions about register A and register B:

    1.ADD A, B means a += b. The machine code is 80 AF BF.

    2.ADD A, A means a += a. The machine code is F0 AF.

    3.ADD B, B means b += b. The machine code is F0 BF.

    4.ADD B, A means b += a. The machine code is 80 BF AF.

    Now give you the values in register A and register B and some machine codes. You should calculate out the final value in register A and register B after operating the machine code.

  • 输入
  • The frist line contains an integer T, means there are T test cases.
    For each test case, the first line contains two integers means the initial value of the register A and the register B in hexadecimal(十六进制).
    The next line contains a series of hexadecimal numbers.
  • 输出
  • For each test case, print the register A and register B's value in hexadecimal.
  • 样例输入
  • 2
    A1 B2
    80 AF BF F0 AF
    B2 B3
    F0 AF F0 BF
  • 样例输出
  • 2A6 B2
    164 166
    
  • 提示
  • The first case's machine codes 80 AF BF F0 AF is composed of ADD A, B and ADD A, A.
  • 来源
  • Monkeyde17
  • 操作

显示春菜