Photoshop CS5: click Help > Deactivate
Then re-image your computer. Re-install Photoshop CS5 via the Photoshop installer so that the software activates correctly.
Lightroom has no activation mechanism. Re-image then re-install.
Lightroom doesn't matter. You can just install the program again. With Photoshop, I believe there is an option in the help menu to enable you to deactivate Photoshop. Then you can just install again after the computer is repaired.
The most important thing is to make sure you have your serial numbers for LR and PS-CS5, and if either is an upgrade then have the serial number of the previous version available, as well.
If you have registered your products with Adobe, then the serial numbers should be online. If not then register your products before reimaging your computer, and verify the serial numbers are online at Adobe.com.
And to directly answer your question, you don’t inform Adobe, you merely deactivate PS, reimage, then reinstall and reactivate PS with the serial number(s), and relicense LR with the serial number(s).
If this computer isn’t yours and you don’t have the serial numbers, yourself, then that could be a problem, although there may be software that can find the serial numbers. On a PC platform, download and run the Belarc Security Advisor and see if it finds the serial numbers you need. It’ll only find the current product serial numbers, not the prior versions that an upgrade might be based on, so then you’ll be stuck.