Get second line and append to part of first line

I have a file ( test ) that looks like below and I am trying to match for *.tif and print the output to another file expecting the output to be something like /opt/apps/image/35645-3456.tif . I would greatly appreciate any ideas you can provide.

#cat test
/opt/apps/image/3456.tif
    35645
/opt/apps/image/1234.tif
    35656
/opt/apps/image/2345.tif
    12356

Is this a homework assignment? Homework and coursework questions can only be posted in the Homework & Coursework forum under special homework rules.

If you did not post homework, please explain the company you work for and the nature of the problem you are working on and show us what you have tried to solve this problem on your own.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.