Which part of this is giving you trouble? What do you have so far? Where exactly are you stuck?

You've mentioned about 5 different parts of the problem. Narrow it down, start smaller, and ask a...