Let us place at random the digits from 1 to 9 into the cells of 3x3 square.

What is the probability of getting a configuration such that the 8 sums (3 rows, 3 columns and 2 main diagonals) will be represented by 8 distinct numbers?

Construct at least one such square.

Extra challenge:

Same two tasks for 4x4 square , numbers 1 to 16 and 10 distinct sums.