Codeforces C. Adding Powers
C. Adding Powers Suppose you are performing the following algorithm. There is an array v 1 , v 2 , … , v n v1,v2,…,vn filled with zeroes at start. The following operation is applied to the array several times — at i i-th step ( 0 0-indexed) you can: either choose position p o s pos ( 1 ≤ p o s ≤ n 1≤pos≤n) and increase v p o s vpos by k i ki; or not choose any position and skip this step. You can choose how the algorithm would behave on each step and when to stop it. The question is: can you make array v v equal to the given array a a ( v j = a j vj=aj for each j j) after some step? Input The