Cooperative Resource Allocation in Integrated Terrestrial/Non-Terrestrial 5G and Beyond Networks