GCD operations CodeChef lunchtime Problem solution with explanation-
Problem Statement-
Consider a sequence , where initially, for each valid . You may perform any number of operations on this sequence (including zero). In one operation, you should choose two valid indices and , compute the greatest common divisor of and (let's denote it by ), and change both and to .
You are given a sequence