you give integer n dx_1 dy_1 dx_2 dy_2 you select n distinct pair integer x_i y_i way possible pair integer x y exist exactly triple integer b meeting follow constraint begincase x x_i cdot dx_1 b cdot dx_2 y y_i cdot dy_1 b cdot dy_2 endcase