Maximization of a survival probability and its application