max product constant memory