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 | 3773 |
3 | Radewoosh | 3646 |
4 | ecnerwala | 3624 |
5 | jqdai0815 | 3620 |
5 | Benq | 3620 |
7 | orzdevinwang | 3612 |
8 | Geothermal | 3569 |
8 | cnnfls_csy | 3569 |
10 | gyh20 | 3447 |
# | User | Contrib. |
---|---|---|
1 | awoo | 161 |
2 | maomao90 | 160 |
3 | nor | 157 |
4 | atcoder_official | 156 |
4 | cry | 156 |
6 | -is-this-fft- | 155 |
7 | maroonrk | 154 |
8 | adamant | 153 |
9 | Um_nik | 151 |
10 | djm03178 | 146 |
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