January Long

[Solved] Maximum of GCDs January Long 2023 CodeChef

[Solved] Maximum of GCDs January Long 2023 CodeChef

Maximum of GCDs: You are given an array A of N positive integers.The power of a subarray A[L,R] (1≤L≤R≤N) having size (R−L+1) is defined as gcd(AL​,A(L+1)​,…,AR​), where gcd⁡ denotes the greatest common divisor. Your task is to find the maximum power of a subarray of size k, for all 1≤k≤N. A subarray is formed by deleting some (possibly…