

‘A’, ‘B’ and ‘C’ can be equal to 0.
The first line contains a single integer ‘T’ representing the number of test cases.
The first line of each test case contains three space-separated integers ‘A’, ‘B’, and ‘C’ representing the coefficients of the quadratic equation.
The second line of each test case will contain a single integer ‘N’ which denotes the size of the ‘ARR’.
The third line of each test case will contain ‘N’ space-separated integers, representing the elements of ‘ARR’.
For each test case, return all the outputs in non-decreasing order.
Output for every test case will be printed in a separate line.
You don’t need to print anything; it has already been taken care of. Just implement the given function.
1 <= T <= 50
1 <= N <= 10^5
-10^5 <= A, B, C < =10^5
-10^5 <= ARR[ i ] <= 10^5
Time limit: 1 sec
We will create a helper function, to evaluate the value of the equation for a given input.
long long QUADRATIC_EVALUATION(long long a, long long b, long long c, long long x)
It takes coefficients and the current element of ‘ARR’ as the input and returns the correspondent output.
We will go through all the inputs and store their ’QUADRATIC_EVALUATION’ in an array and then sort the array.
We will create a helper function, to evaluate the value of the equation for a given input.
long long QUADRATIC_EVALUATION(long long a, long long b, long long c, long long x)
It takes coefficients and the current element of ‘ARR’ as the input and returns the correspondent output.
Depending on the coefficient 'A', the quadratic function is first increasing then decreasing, or first decreasing and then increasing. We will create 'ANS' to store the final result. Depending on the value of 'A' we will fill in from the left side or the right side.