Richarlison struck a first-half hat-trick as Brazil beat Germany 4-2 in their Olympics Men's Football Group D opener.