Optimization of the form of a building on an oval base