The more the deviation from incident ray, the more is the optical density of the medium and less will be the speed.
incident = 45
a ----> 30, deviation = 45-30 = 15
b ----> 40, deviation = 45-40 = 5
c ----> 45, deviation = 45-45 = 0
So the velocity will be maximum in C as deviation is minimum.
Note: The incident and refracted angle are the same in medium C. So there is no change in optical density of medium. So in third case, there is no refraction.