Company: Infosys_13july
Difficulty: medium
Divisible Game Problem Description You are given an array A of length N. Alice and Bob are playing a game called Divisible Game. The game consists of the following steps: First, Alice must choose any integer G that is strictly greater than 1. After that, Alice will choose two integers (l, r) such that 1 <= l <= r <= N. Let the score of both players be equal to 0 initially. For each element i such that l <= i <= r, if A i is divisible by G, the score of Alice will increase by A i , otherwise the score of Bob will increase by A i . Alice wants the value of her score - (minus) Bob's score to be as large as possible. Not only that, but she wants to find the minimum value of G that will result in this difference. Find the value of (maximum score difference) * (minimum G to get this score). Since the result can be large return it modulo 10^9 + 7. Input format The first line contains an integer, N, denoting the number of elements in A. Each line i of the N subsequent lines (whe