I have read this sentence on a book about the Snell's law of refraction, referring on a ray that passes from air (n1=1$n_1=1$) to glass (n2=1.55$n_2=1.55$):
"Snell's equation can be derived from Fermat's principle of least time. The path length in air has been increased relative to the path length in glass since the speed in air (c/n1) is greater than the speed in glass (c/n2). This is analogous to the situation of a lifeguard who must rescue a swimmer who is down the beach and out to sea. Since the guard can run faster then he can swim, he should not head directly for the swimmer but should run at an angle so that the distance covered on the beach is greater than the distance in the water and the total time can be minimized"
"Snell's equation can be derived from Fermat's principle of least time. The path length in air has been increased relative to the path length in glass since the speed in air ($c/n_1$) is greater than the speed in glass ($c/n_2$). This is analogous to the situation of a lifeguard who must rescue a swimmer who is down the beach and out to sea. Since the guard can run faster then he can swim, he should not head directly for the swimmer but should run at an angle so that the distance covered on the beach is greater than the distance in the water and the total time can be minimized"
I do not understand it. Why should we increase the path in air? From this sentence it seems that in order to reduce the total time (of travelling in air and in glass), we have to increase the path in air (and what does it mean?).