Optimal Deployment of Base Stations in Cognitive Satellite-Terrestrial Networks