Problem

Source: 2017 Polish Junior Math Olympiad Second Round

Tags: number theory



Let $a$, $b$, and $d$ be positive integers. It is known that $a+b$ is divisible by $d$ and $a\cdot b$ is divisible by $d^2$. Prove that both $a$ and $b$ are divisible by $d$.