An Dynamic Programmic algorithm for this problem

We have some blocks of the tower(n) with the same Height(each of them has 1 as its Height)

each block has Weight(w) and maximum Tolerable weight(L).each block can withstand a certain weight(L).

if a load(total weight) is placed on them more than the Tolerable weight, the tower will fall.

in addition, we must be careful not to mount on any block of the tower more than its weight,
otherwise, the tower will fall.

how can we get the tallest tower with dynamic programming?