#C11363. Maximum Minimized Absolute Difference
Maximum Minimized Absolute Difference
Maximum Minimized Absolute Difference
In this problem, you are given an array of integers. Your task is to find the maximum minimized absolute difference among all subarrays of the array.
A subarray is defined as a contiguous segment of the original array. The absolute difference of a subarray is computed as \(\lvert max - min \rvert\), where max and min are the maximum and minimum values in that subarray respectively.
Notice that if you choose a subarray consisting of only one element, the difference will be \(0\) (since \(max = min\)). In fact, it is always possible to achieve a difference of \(0\). Therefore, the answer for any valid input is always 0
.
Your program should handle multiple test cases. For each test case, output the computed result on a new line.
inputFormat
The first line contains an integer \(T\) (the number of test cases).
Each test case is described as follows:
- The first line of each test case contains an integer \(n\) (the size of the array).
- The second line contains \(n\) space-separated integers representing the array elements.
outputFormat
For each test case, output a single integer — the maximum minimized absolute difference. As explained, this value will always be 0
.
1
3
7 7 7
0
</p>