1346.Text data calculation -- How to calculate time difference of two adjacent and matched lines?

How to calculate the time (1st column) difference between two consecutive lines where the 2nd and 5th columns are the same, and the 5th column is non empty? Output the 1st, 2nd, 3rd columns of the 2nd line, and the result. Thanks