#C14248. List Transformation Challenge

    ID: 43876 Type: Default 1000ms 256MiB

List Transformation Challenge

List Transformation Challenge

You are given a list of integers and an integer M. Your task is to transform the list by applying the following formula to each element:

f(x)=x2Mf(x) = x^2 - M

That is, for each integer x in the list, compute its square and then subtract M from the result. Print the transformed list. If the list is empty, output nothing.

Note: The output values should be separated by a single space.

inputFormat

The input consists of two lines. The first line contains two integers n and M separated by a space, where n is the number of elements in the list and M is the integer to subtract from each squared value. The second line contains n space-separated integers. If n is 0, the second line will be empty.

outputFormat

Output a single line containing the transformed list with each element separated by a single space. There should be no extra spaces at the beginning or end of the line.## sample

4 3
2 3 4 5
1 6 13 22