ok... hmmm we know the length of the board is just 2.5meters
let's say
a = first shelf
b = second shelf
c = third shelf
d = fourth shelf
so, we know their sum must be 2.5, or a + b + c + d = 2.5
now, what is twice the first one? or "a"? 2*a or 2a, now, what's 18 longer than 2a? 2a + 18
so b = 2a + 18
now, what is 12 shorter than "a"? well a - 12
so c = a - 12
and the "remaining", namely "d", is 4 longer than "a"
so d = a + 4
so

solve for "a"
how long is the second shelf? well b = 2a + 18