answer is 4000002000000. used iterative method
Merge pull request #2 from cprater/q2

answer is 4000002000000. used iterative method