lattice

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Write a function P1:

  • A point (x,y)(x,y) is called a lattice point iff both xx and yy are integers.

  • input parameter: integers x1, y1, x2, y2, x3, y3

    • Three points (x1y1), (x2y2), (x3y3) are not on a same straight line.
    • The absolute value of each input parameter is less than or equal to 210242^{1024}.
  • return value: the number of the lattice points (including vertexes) on the perimeter of the triangle with three vertexes (x1y1), (x2y2), (x3y3)

    • For example, if a triangle has vertexes (0,0),(2,2),(3,0)(0,0),(2,2),(3,0) then its perimeter has 6 lattice points: (0,0),(1,1),(2,2),(3,0),(2,0),(1,0)(0,0),(1,1),(2,2),(3,0),(2,0),(1,0).