SIMPLE LCM - COW3G

Someone please give me a proof for this problem’s solution : COW3G
I solved it with an intuitive approach but later i have no idea why this works.
Here’s my solution :- Solution

Check the editorial for this problem , your solution passed because of weak test cases (which have been updated ) , this won’t pass now

1 Like

Thanks :slight_smile:

Sir,I am really not being able to understand this editorial.Has looked up mobius function and divisor function.But not getting the pieces to fit together.Can you kindly write a small editorial for this problem?
Thanks in advance…