An elementary theorem in plane geometry and its multidimensional extension