Answer :

Input
Output
(Sorry for not being detailed)

Other Questions