Optimum Power Allocation for Cooperative Communications