It is well known that ax ≡ b (mod q) can be solved for x in applying meet-in-the-middle optimization after rewriting an equation like that agk ≡ bah (mod q), where gk - h = x.
How can one solve (ax mod p) ≡ b (mod q), where p, q are prime numbers and p > q?