This question was given in an olympiad booklet in my country. It is also present in the Chinese book : 物理竞赛专题精编 (江四喜). It is from a Russian olympiad as far as I can guess. Please solve this question, it will be of huge help.
You should use there Snell’s law - law of refraction
The angles you use in this formula are measured from the ray to the normal of the given surface
You can take the air’s index of refraction to be equal to 1