NC22366. Saintly … Coins
描述
输入描述
The first line contains two integers , the initial number of coins in each stack and the number of stacks, respectively.
Each of the following n lines contains a string consisting of {A, B, C, D, E, F, X, Y}, where characters {A, B, C, D, E, F} refers to denominations {1, 5, 10, 50, 100, 500} respectively, and the j-th character in the i-th line describes the type of the coin at (i, j). Notice that the character matrix is upside down for input.
It is guaranteed that there are at most 20 special coins (i.e. the coins of types X and Y).
输出描述
Output a single integer K at the first line, the total number of rounds.
Each of the following K lines contains a character and two integers. The character describes the type (in {A, B, C, D, E, F, X, Y}, as the input) which he chooses in thatround, and the integers are the index of the chosen stack and the score increment in thatround, respectively.
示例1
输入:
6 3 EEF EED ACC AAC AAC AAC
输出:
3 A 1 12 D 2 7 F 2 2
示例2
输入:
6 3 EEF EED ABC AAC AAC XAX
输出:
2 X 3 22 F 2 2
示例3
输入:
6 3 EEF EED ACC AAC AAC YAY
输出:
1 Y 3 12
示例4
输入:
7 2 EE FF FA AD DC EE YY
输出:
2 Y 1 9 D 1 2