SCAM 2021 - Rang De Code Contest

Please help me that why gcd concept is used here and what is the logic behind using this?

This is the question link:

Thanks in advance :slight_smile:

Rishabh we will be posting the editorial tomorrow there we will explain the logic. Thanks for participating in Rang De Code.

1 Like

For a moment I thought that the contest was a scam :rofl:



here is the link of the editorial!
check it out!