#P9022. [CCC 2021 J3] Secret Instructions

    ID: 9905 远端评测题 500ms 128MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>模拟2021基础算法CCC(加拿大)

[CCC 2021 J3] Secret Instructions

Problem Description

Multiple test cases.

For each test case, read in 55 digit characters.

  • If the sum of the first two digits is odd, output left.
  • If the sum of the first two digits is a non-zero even number, output right.
  • If the sum of the first two digits is zero, output left or right depending on the previous test case.

Then output a space and the last three digit characters.

Input Format

Multiple test cases.

Each line contains 55 digit characters.

Read until 99999.

Output Format

For each line, output one string and 33 digit characters, separated by a space.

57234
00907
34100
99999

right 234
right 907
left 100

Hint

The third character read will not be 00.

The first test case will not start with 0000.

Translated from CCC2021 J3.

Translated by ChatGPT 5