Each brick is uniform, so its centre of gravity is at its middle, 10 cm from either end. Measure all positions horizontally from the table edge, positive outwards.
(i) A brick on the table is acted on by its weight at its centre of gravity and by the upward reaction of the table, which can act only where the brick touches the table (up to the edge). The two forces can balance, with zero net torque, only if the vertical through the centre of gravity falls on the supporting surface. At the limit, the centre of gravity is directly above the edge:
d1=10 cm
Largest overhang of one brick =10 cm (half its length).
(ii) The top brick must satisfy the condition of (i) on the lower brick: its centre of gravity can be at most above the right edge of the lower brick, so it projects 10 cm beyond that brick.
Now the two bricks together must satisfy the condition on the table: their combined centre of gravity must be above the table edge. Let the lower brick project e beyond the table edge. Its centre is at e−10 and the top brick's centre is at e (above the lower brick's right end):
X=2mm(e−10)+m(e)=e−5=0⇒e=5 cm
d2=5+10=15 cm
Largest overhang with two bricks =15 cm.
(iii) The top two bricks are arranged as in (ii), so their combined centre of gravity lies above the right end of the third (bottom) brick. Let the bottom brick project e; its centre is at e−10 and the combined centre of the upper two (mass 2m) is at e:
X=3mm(e−10)+2m(e)=e−310=0⇒e=3.33 cm
d3=3.33+5+10=18.3 cm
Largest overhang with three bricks =18.3 cm.
(iv) In the same way, with the upper three bricks (mass 3m) having their combined centre above the right end of the bottom brick:
X=4mm(e−10)+3m(e)=e−2.5=0⇒e=2.5 cm
d4=2.5+3.33+5+10=20.8 cm
Largest overhang with four bricks =20.8 cm, which is more than the length of a brick (20 cm). The top brick lies entirely beyond the edge of the table, yet the stack is in equilibrium. The stack is drawn to scale below; the dots are the centres of gravity of the bricks.

(v) The rule is: for every brick, the combined centre of gravity of that brick and all the bricks above it must lie vertically above the surface supporting it (the brick below, or the table). Only then can the upward reaction and the total weight act along the same vertical line, so that both the net force and the net torque are zero. The successive extra overhangs are 2L,4L,6L,8L,… with L=20 cm.
At the calculated values, each combined centre of gravity is exactly above an edge, so the stack is only just in equilibrium: the slightest disturbance, a slightly uneven brick or a small push, would shift a centre of gravity past an edge and create an unbalanced torque, and the stack would topple. In practice the overhangs must be kept a little less than the limits.