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: https://www.codechef.com/RDEC2021/problems/RDC5.

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:

15 Likes

:rofl:

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