In this problem the number of integers points on a segment is gcd(x,y)+1. where x = abs(x1-x2) and y = abs(y1-y2). But why it does? Anyone please explain it. Thanks in advance.
# | User | Rating |
---|---|---|
1 | jiangly | 3898 |
2 | tourist | 3840 |
3 | orzdevinwang | 3706 |
4 | ksun48 | 3691 |
5 | jqdai0815 | 3682 |
6 | ecnerwala | 3525 |
7 | gamegame | 3477 |
8 | Benq | 3468 |
9 | Ormlis | 3381 |
10 | maroonrk | 3379 |
# | User | Contrib. |
---|---|---|
1 | cry | 168 |
2 | -is-this-fft- | 165 |
3 | Dominater069 | 161 |
4 | Um_nik | 160 |
5 | atcoder_official | 159 |
6 | djm03178 | 157 |
7 | adamant | 153 |
8 | luogu_official | 151 |
9 | awoo | 149 |
10 | TheScrasse | 146 |
Help please!![GCD problem]
In this problem the number of integers points on a segment is gcd(x,y)+1. where x = abs(x1-x2) and y = abs(y1-y2). But why it does? Anyone please explain it. Thanks in advance.
Rev. | Lang. | By | When | Δ | Comment | |
---|---|---|---|---|---|---|
en3 | Muhammad_mhs | 2020-05-22 22:28:12 | 1 | Tiny change: 'of integers points on' -> 'of integer points on' | ||
en2 | Muhammad_mhs | 2020-05-22 22:27:23 | 1 | Tiny change: 'gers point on a segm' -> 'gers points on a segm' | ||
en1 | Muhammad_mhs | 2020-05-22 22:26:52 | 256 | Initial revision (published) |
Name |
---|