#P9736. [COCI 2022/2023 #2] Ekspert
[COCI 2022/2023 #2] Ekspert
Problem Description
You are given four variables , , , with initial values , , , .
You can perform the following operation on them:
Choose two variables, and store their sum into one variable.
Please use this operation no more than times to make the value of at least one variable equal to .
Input Format
One line with two integers , (), with the meaning as described in the statement.
Output Format
The first line outputs a non-negative integer (), indicating the number of operations.
In the next lines, the -th line records the -th operation in the form , meaning to store the sum of and into .
1 2
1
A A A
A
3 2
6
D C C
D C C
D C C
D C C
D C C
D C C
C
Hint
| Score | Special property | |
|---|---|---|
| None. |
This problem has a full score of points.
Translated by ChatGPT 5