#22. 数组条件修改
数组条件修改
Array Modification
Background
Congcong is processing some number sequences. He discovered a special rule that requires adjustments to certain sequences.
Problem Description
Given an integer array of length . If there is a in the array immediately followed by a , set the element to . Return the changed array.
Input Format
Input is given from standard input in the following format.
A single line containing three integers, representing the elements of the array.
Output Format
Output is printed to standard output in the following format.
A single line containing three integers, representing the modified array.
Sample
[1 2 3]
[1, 2, 0]
[2 3 5]
[2, 0, 5]
[1 2 1]
[1, 2, 1]
Sample Explanation
In the first sample, a at index is immediately followed by a at index , so the at index is changed to . In the second sample, a at index is immediately followed by a at index , so the at index is changed to . In the third sample, there is no immediately followed by a , so the array remains unchanged.
Constraints
Time limit: s, Memory limit: KiB for each test case.