This looks like an assignment to me.Your best interest is to try to solve the problem yourself. Give it your best shot.If you get struck, post your solution and we can point out what the problem is.Good luck! :)
Okay, I won't let you go "empty handed".
Here are some pointers: