Q1: P is a point inside a square ABCD of side s, and |PA| = 5, |PB| = 3, and |PC| = 7. Find s.

Q2: P is a point inside a hexagon ABCDEF of side s, and |PA| = 2, |PF| = 3, and |PE|=4. Find s.

Can somebody please explain how to do these with maths, and also explain in English how they are done? Thanks!