answered 2015-09-20 04:06:13 -0600
i have made a small change to squares.cpp like here
result :
updated 2015-09-20 04:09:31 -0600
updated 2015-09-20 04:17:40 -0600
this is not a complate answer. just initial work to understand desired result.