Generate an array A, such that gcd of all its contiguous subarray is present in the given array G. If it is not possible to generate such an array then print -1. Read more →
Subarray
2 postsGiven an array of N elements. You have to partition the array into two non-empty subarrays such that every number in the right subarray is strictly greater than every number in the Read more →