Baseline Optimization for the Measurement of CP Violation, Mass Hierarchy, and $\theta_{23}$ Octant in a Long-Baseline Neutrino Oscillation Experiment