Text this: Algorithm on joint optimization of power allocation and slot allocation in satellite communication systems