← 返回 meta 的题目列表Sort Transformed Array with Simplifications
类型:online_judge
Given an integer array nums and three integers a, b, and c. Create a new array where each element is obtained by applying the quadratic function f(x) = ax^2 + bx + c to each element in nums. Then sort the new array and return the sorted array.
Input Format:
The first line contains three integers a, b, and c.
The second line contains an integer n, representing the length of nums.
The third line contains n integers, representing the elements of nums.
Output Format: Print one line containing the sorted array.
Example:
Input:
1 3 5
4
-4 -2 2 4
Output:
3 9 15 33
Constraints:
-100 <= nums[i] <= 100
1 <= nums.length <= 10^4
-100 <= a, b, c <= 100
Example
Input
1 3 5
4
-4 -2 2 4