solve the medium (10 power 14) case for fair and square problem
solve pat 1003 problem