Company: Netcore backend dev_2nov
Difficulty: medium
Maximum Remainder Problem Description You are given an array A of N integers, where N is even and exactly N/2 of the values are even while the other N/2 are odd. You are also given a modulus k . Pick one even value and one odd value from A , add them, and take the remainder of that sum modulo k . Over every such pair, report the largest remainder you can obtain. Function Description Complete the find_maximum_remainder function. It takes the following parameters: N : INTEGER, the size of the array. A : LONG INTEGER ARRAY of size N . k : LONG INTEGER, the modulus. The function must return a LONG INTEGER, the maximum value of (even + odd) % k . Input Format The first line contains the integer T , the number of test cases. Each test case is three lines: the integer N ; N space-separated integers, the array A ; and the integer k . Output Format For each test case, print one line holding the maximum remainder. Constraints 1 <= T <= 10 1 <= N <= 9000 and N is even (inferred -- the