spoj problem rectangles done.