Determine a general formula for the maximum total distance spanned by n bricks if they are to remain stable. the length of each brick is l.