recursive max area in rectangle algorithm