How to Apportion Your R&D Costs