You can
put this solution on YOUR website! .
Couple of notices.
1. The problem is written INCORRECTLY.
2. I think that it will be TOO MUCH for you, if I will first correct/edit your wrong post, and then will solve it for you.
Posting wrong problem, you DID NOT DESERVE it.