\[5a + 5y + pa + py =\]
\[= 5 \cdot (a + y) + p(a + y) =\]
\[= (a + y)(5 + p)\]
\[Проверка:\]
\[(a + y)(5 + p) =\]
\[= 5a + 5y + pa + py\]
\[\Longrightarrow верно.\]