CF1941B Rudolf and 121

Description

Rudolf has an array $ a $ of $ n $ integers, the elements are numbered from $ 1 $ to $ n $ . In one operation, he can choose an index $ i $ ( $ 2 \le i \le n - 1 $ ) and assign: - $ a_{i - 1} = a_{i - 1} - 1 $ - $ a_i = a_i - 2 $ - $ a_{i + 1} = a_{i + 1} - 1 $ Rudolf can apply this operation any number of times. Any index $ i $ can be used zero or more times. Can he make all the elements of the array equal to zero using this operation?

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the first example, the original array is $ [1, 3, 5, 5, 2] $ , to make all its elements zero, Rudolf can act as follows: - apply the operation at $ i=4 $ and get the array $ [1, 3, 4, 3, 1] $ ; - apply the operation at $ i=3 $ and get the array $ [1, 2, 2, 2, 1] $ ; - apply the operation at $ i=2 $ and get the array $ [0, 0, 1, 2, 1] $ ; - apply the operation at $ i=4 $ and get the array $ [0, 0, 0, 0, 0] $ .