22689_Dosolveitdirectly

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

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

Pro.ID

22689

Title

Do solve it directly

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    The Imagine Cup Algorithm Semifinals are in the form of a game called Herbert. Herbert requires you to solve a series of levels by writing small programs to control a robot.

    Herbert is programmed in a simple but powerful language called "h". "h" contains elements of traditional high-level languages: statements, procedures, parameters, arguments, and recursion. However, "h" is syntactically simpler, and contains some concepts (procedural arguments) that are not found in traditional languages.

    Here are the basic elements of "h":


    A player, named mathmike did a really good job. He invented a funny function z(A, B) to represent an instruction sequence. This function is very efficient. Definition of it is described here:

    z(A, B) = sz(A-B, B)rz(B-A, A)

    The Herbert is initially placed at (0,0), and faces to (0,1).

    If A=2, B=3 then the Herbert will execute the following instructions: "srsrsr". In the end, the Herbert will locate at (1,0).

    输入

    The first line of the input is a positive integer C, denoting the number of test cases followed.

    The input of each test case is two non-negative integers A and B ( 0 ≤ A, B ≤ 10000 ).

    输出

    Description

    The Imagine Cup Algorithm Semifinals are in the form of a game called Herbert. Herbert requires you to solve a series of levels by writing small programs to control a robot.

    Herbert is programmed in a simple but powerful language called "h". "h" contains elements of traditional high-level languages: statements, procedures, parameters, arguments, and recursion. However, "h" is syntactically simpler, and contains some concepts (procedural arguments) that are not found in traditional languages.

    Here are the basic elements of "h":


    A player, named mathmike did a really good job. He invented a funny function z(A, B) to represent an instruction sequence. This function is very efficient. Definition of it is described here:

    z(A, B) = sz(A-B, B)rz(B-A, A)

    The Herbert is initially placed at (0,0), and faces to (0,1).

    If A=2, B=3 then the Herbert will execute the following instructions: "srsrsr". In the end, the Herbert will locate at (1,0).

    Input

    The first line of the input is a positive integer C, denoting the number of test cases followed.

    The input of each test case is two non-negative integers A and B ( 0 ≤ A, B ≤ 10000 ).

    Output

    The output should consist of C lines, one line for each test case, only containing two integers X and Y, which represent the final coordinates of the Herbert. No redundant spaces are needed.

    Sample Input

    1
    2 3

    Sample Output

    1 0

    Source

    样例输入

    1
    2 3

    样例输出

    1 0

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部