Nonadiabatic transitions due to curve crossings: Complete solutions of the Landau-Zener-Stueckelberg problems and their applications