Approach 1
This can be solved in O(n^3) time by using the Hungarian algorithm where n is max(len(list),len(input)).
First set up a matrix that gives the cost of assigning each input to each number in the list.
matrix[i,j] = abs(input[i]-list[j])
Then use the Hungarian algorithm to find the minimum cost matching of inputs to numbers in the list.
If you have more numbers in the list than inputs, then add some extra dummy inputs which have zero cost of matching with any number in the list.
Approach 2
If the first approach is too slow, then you could use dynamic programming to compute the best fit.
The idea is to compute a function A(a,b) which gives the best match of the first a inputs to the first b numbers in your list.
A(a,b) = min( A(a-1,b-1)+matrix[a,b], A(a,b-1) )
This should give an O(n^2) solution but will require a bit more effort in order to read back the solution.