A question about AGC051 Problem E

Revision en1, by SHZhang, 2020-12-30 06:20:13

In one key step of solving AtCoder Grand Contest 051, Problem E, one must solve the following subproblem (see the editorial for more information):

Given $$$n$$$ vectors $$$P_1, P_2, \cdots, P_n$$$, whose x- and y-components are integers, the set of vectors that can be expressed as $$$\Sigma w_iP_i$$$, where $$$w_i$$$ are arbitrary integers, can be expressed as {$$$mA + nB \mid m, n \in \mathbb{Z} $$$} (I understand why this is true), where $$$A$$$ and $$$B$$$ are some vectors. Find $$$A$$$ and $$$B$$$.

The editorial states that the problem can be solved using a "gcd-like algorithm", but I am struggling to figure out what the algorithm actually is. Can someone provide more details? This appears to be an interesting problem that can be useful for solving other problems as well.

Tags agc051

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English SHZhang 2020-12-30 06:20:13 896 Initial revision (published)