A slightly different take on the corner problem

Determine the longest beam that can turn the corner of two halls of given width,

**x**and**y**.- The general solution.
- The extent of the path of the beam.

In the calculations, I use both **L** and **R** to represent the beam length; I use **L** when finding the maximum length; I use **R** when the beam length is given.

General solution