R, 33 - 3 = 30
a=scan();b=rep(a,a);rev(b)%*%t(b)
Long versionExplanation:
a=scan() # take numeric input b=rep(a,a) # repeat each numeric input by itself and store as vector rev(b)%*%t( # the reverse of vector b) %*% # matrix multiplication of reversed vector and t(b) # the transposed of vector b
This also works for more than two numbers. For example, the output for (5,3,2) looks like this:
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 10 10 10 10 10 6 6 6 4 4 [2,] 10 10 10 10 10 6 6 6 4 4 [3,] 15 15 15 15 15 9 9 9 6 6 [4,] 15 15 15 15 15 9 9 9 6 6 [5,] 15 15 15 15 15 9 9 9 6 6 [6,] 25 25 25 25 25 15 15 15 10 10 [7,] 25 25 25 25 25 15 15 15 10 10 [8,] 25 25 25 25 25 15 15 15 10 10 [9,] 25 25 25 25 25 15 15 15 10 10 [10,] 25 25 25 25 25 15 15 15 10 10