Lời giải:
Gọi số bị chia là $a$ và số chia là $b$. Theo bài ra ta có:
$a=5\times b+12$
$a=(b+12)\times 3+18$
$\Rightarrow 5\times b+12=(b+12)\times 3+18$
$\Rightarrow 5\times b+12=3\times b+54$
$\Rightarrow 5\times b-3\times b=54-12$
$\Rightarrow 2\times b=42$
$\Rightarrow b=42:2=21$
Số bị chia là: $5\times 21+12=117$