Friday, June 24, 2011

diagonals and interior points for rectangles

You are given a R rectangle  a x b of integer size. Each rectangle contains unit blocks, consider the diagonal and count how many blocks c are touched by the diagonal. Given a value K how many rectangles have exactly K block touching the diagonal?  here an example



I found this problem online but was not able to solve it so far

4 comments: