Sponsored
Use these hints if you're stuck. Try solving on your own first.
Eq. ax+by=1 has solution x, y if gcd(a,b) = 1.
Can you generalize the formula?. Check Bézout's lemma.
Solve with full IDE support and test cases