# How to solve this “Pizza Slice” Geometry problem?

From the Codechef Contest (problem and [solution] https://discuss.codechef.com/t/pizza-slice-xypizq-mini-editorial/21639 , https://discuss.codechef.com/t/xypizq-editorial/21634 ):

ChefX showed ChefY his new pizza slice design. The design is a planar figure that can be drawn in the following way:

Draw a point $$A0$$ and two rays from this point such that the angle between them is $$α<π/2.$$

Mark N points $$A1,A2,A3,…,AN$$ on one ray in this order ($$A1$$ is closest to $$A0$$).

Mark N points $$B1,B2,B3,…,BN$$ on the other ray in this order ($$B1$$ is closest to $$A0$$).

For each valid i, draw a line segment between points Ai and Bi+1.

For each valid i, draw a line segment between points Bi and Ai+1.

Finally, draw a line segment between points AN and BN.

All these 2N−1 line segments must have equal lengths, which must also be equal to $$|A0A1|=|A0B1|.$$ Can you help ChefX find the angle ChefY asks for? It can be proved that under the given constraints, each angle can be written as π⋅m/n, where m and n are coprime integers; you should find m and n.

In short, I am not able to understand the author's solution for calculating any angle in the triangle. Also, the author's solution says that the pizza slice is always an isosceles triangle...how can that be proved ?

Notice, first of all, that once you have laid down the chain $$A_0 A_1 B_2 A_3 B_4 \dots$$ then the other chain is the symmetric of that. If $$\alpha$$ is the angle at $$A_0$$, then in isosceles triangle $$A_0 A_1 B_2$$ we have $$\angle A_0 B_2 A_1=\alpha$$ and $$\angle A_0 A_1 B_2=\pi-2\alpha$$. We thus find that $$\angle B_2 A_1 A_3=2\alpha$$ and, going on with the same reasoning as before, $$\angle A_1 B_2 A_3=\pi-4\alpha$$, $$\angle A_3 B_2 B_4=3\alpha$$, and so on. Hence: $$\angle A_k B_{k-1} B_k=\angle B_k A_{k-1} A_k=k\alpha.$$
The chain stops if $$A_n=A_{n+1}$$ for some $$n$$ ($$n=4$$ in the figure). But $$A_0A_nB_n$$ is an isosceles triangle, hence $$\angle B_n A_n A_{n-1}=\angle B_n A_{n-1} A_n=(\pi-\alpha)/2$$ and comparing with the above result we get $$n\alpha=(\pi-\alpha)/2$$, that is: $$\alpha={\pi\over2n+1}.$$ 