How many consecutive sums a board contains

How can I solve the following: I have a 4x4 board such that every square must be an integer (note that negative integers and zero are allowed). The square has 30 subsquares Ai, and I will denote the sum of its elements by s_i. Is it possible to show that integer can be choosen such that {1,2,…,24} is a subset of {s_1,…,s_{30}}?

For example, if we have square

1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1

Then it sums are 1,1,…,1 (16 times), 4,4,4,…,4 (9 times), 9,9,…,9 (4 times) and 16 (one time). But now for example the number 2 is not a sum of elements of any square.

In general case, the sum of elements of squares of

a b c d

e f g h

i j k l

m n o p


a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, a+b+e+f, b+c+f+g, c+d+g+h, e+f+i+j, f+g+j+k, g+h+k+l, i+j+m+n, j+k+n+o, k+l+o+p, a+b+c+e+f+g+i+j+k, b+c+d+f+g+h+j+k+l, e+f+g+i+j+k+m+n+o, f+g+h+j+k+l+n+o+p, a+b+e+f+g+h+i+j+k+l+m+n+o+p

so is it possible to pick 24 of those numbers such that those numbers are 1,2,…,24 in some order.

Can you rewrite your question I missed the meaning of

“Is it possible to show that integer can be chosen such that {1,2,…,24} is a subset of {s_1,…,s_30}?”

or give us some example.

Is board

1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1

ok. If not, why?

I tried to clarify the problem statement.

Did I understand it well, that you want all integers in range 1…24?

Yes. That is correct.

Quite difficult, only 6 sums can be same or out of range. Are negative numbers also possible?

Negative numbers and zero are possible.

This solves the problem:

-42  22  23   7
 13  11 -32  14
-23  16  15   8
 19   9 -22   1

Terima kasih dan salam kenal.
codechef Link

code Link