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 | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 166 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 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