If you have left over hammers, it contributes to whatever you're building next, up to the same number of hammers as what you just built.
So, for your example, you would still have 50 hammers left over to contribute to something else. If the next thing that you built was 150 hammers, it would...