Блог пользователя altrko

Автор altrko, история, 2 месяца назад, По-английски

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

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
2 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by altrko (previous revision, new revision, compare).

»
2 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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?

»
2 месяца назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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.