Total length = 5 * 124 = 620
Since median length is 140 and you need the max length of the shortest piece of wood, then the shortest length of the two longer pieces can be 140 and 140. Now you have three pieces each with the length of 140.
620 - (140 * 3) = 200
200 left for the the two shorter pieces. The max length of the shortest piece can be 100 (200 / 2). So the 5 pieces are: 100, 100, 140, 140, 140.