A songwriting savage: The-Dream on penning Beyoncé-Megan hit