Now that i think about it, i wonder same in life as well.
1967B1 - Reverse Card (Easy Version)
if a+b ⋮ b*gcd(a,b) then a ⋮ b*gcd(a,b) so gcd(a,b) is b therefor a⋮b^2
p.s i didn't get the editorial so someone telling me it would be nice as well
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
Now that i think about it, i wonder same in life as well.
1967B1 - Reverse Card (Easy Version)
if a+b ⋮ b*gcd(a,b) then a ⋮ b*gcd(a,b) so gcd(a,b) is b therefor a⋮b^2
p.s i didn't get the editorial so someone telling me it would be nice as well
Name |
---|
Auto comment: topic has been updated by altrko (previous revision, new revision, compare).
By definition, a ⋮ gcd(a,b) and b ⋮ gcd(a,b), so if a ⋮ b*gcd(a,b) its not necessary that a ⋮ b. I think I understood the editorial, when did it stop making sense for you?
the whole basically
ok,so we know that (a+b)%(b*gcd(a,b))=0.now it only satisfies when a=b*y.since b*gcd(a,b) divides a+b think of it in this way if b a!=b*d,then (a+b)%b!=0,so the (a+b)%(b*gcd(a,b))!=0,so we can never get a pair when a%b!=0,thus a%b=0,now we can replace (a+b) as,b*(y+1),now talking about b*gcd(a,b).we can write it has b*gcd(b*y,b),now gcd(b*y,b)=b,thus we can say that b*gcd(a,b)=b*b,now b*(y+1)=b*b*t.we need to find t,b cancels from both side and we get (y+1)=b*t,now we need the maximum value of y on lhs it is nothing but ⌊n/b⌋,thus we get (⌊n/b⌋+1)=b*t,t=(⌊n/b⌋+1)/b.now run loop from 1 to m and keep adding your t value.
understood ty