A solid body of volume V and surface area S is formed by joining together two cubes of different sizes so that every point on one side of the smaller cube is in contact with the larger cube. If S = 10 m2, find the maximum and/or minimum values of V for which both cubes have non-zero volumes?