Line and squares
In a rectangular Cartesian coordinate system defined by two straight line belonging to her points (0, W) and (100N, E). Also raised N^2 squares with sides parallel to coordinate axes. Square of S_i_{,j} is the coordinate angles (100i, 100j) and (100i - 100, 100j - 100), i, j = 1, 2, ..., N. Required to find the number of squares having a common point with the line.
Прослушать
На латинице
Словарь - Открыть словарную статью
существительное
message
communication
report
announcement
information
news
notice
notification
statement
service
account
word
advice
item
disclosure
announcing
intimation
transaction
conveyance
intelligence
commerce
piece of information
Input
The first line contains three integers, N, W and E, separated by spaces.
1 ≤ N ≤ 100, 0 ≤ W, E ≤ 100N, all numbers are integers.
Output
Output a single number - the number of squares.