Optimal Resource Allocation in Distance-Adaptive Few-Modes Backbone Networks with Flexible Grid