This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Assume the rectangular grid on the 2-dimensional Cartesian coordinate system, with the left lower corner at ( 0 , 0 ) position. The line has the slope 5 0 1 3 and the intersection of the line with each vertical line x , happens at 5 0 1 3 x . We know that at least one square from each column would be passed by the line (the answer would be at least 5 0 ). The line would not pass more than 2 squares from each column. If it does so, the slope of the line would be greater than 1 (contradiction!). In order to find those column, in which two squares would contribute to the final answer, we need to find integer 0 ≤ x < 5 0 , such that 5 0 1 3 x − ⌊ 5 0 1 3 x ⌋ > 5 0 3 7 or, in other words, ⌈ 5 0 1 3 x ⌉ − 5 0 1 3 x < 5 0 1 3 . To find such x , we should see for which x
1 3 x ( m o d 5 0 ) > 3 7
since 0 ≤ x < 5 0 and, x = y , 0 ≤ x , y < 5 0 iff 1 3 x ( m o d 5 0 ) = 1 3 y ( m o d 5 0 ) , there are exactly 4 9 − 3 8 + 1 = 1 2 such x . so, the solution is 5 0 + 1 2 = 6 2 .