31-52 and 27-50, 5-25 and 7-31 [download]
In reply to Calculate the overlap length between two ranges by Anonymous Monk