Given a rectangle on 2D plane ((0,0),(a,b))
where 2 <= a,b <= 1000
, two different points of me and another person (x_1, y_1) != (x_2, y_2)
such that 0 < x_1,x_2 < a
and 0 < y_1,y_2 < b
, and d
— the range of our gun where 2 <= d <= 10000
, find how many angles we can shoot at so that the bullet hits the other person and traveled at most a distance d
.
Shooting another person means that after the bullet goes in one direction, reflects geometrically against the walls, and repeating those actions, it hits the other person.