Question: Write a python program which inputs a,b,m,n (all are integers) m and n being greater than or equal to 1. The gcd(m,n) = 1. Implement

Write a python program which inputs a,b,m,n (all are integers) m and n being greater than or equal to 1. The gcd(m,n) = 1. Implement chinese remainder theorem to output the smallest nonnegative integer x which solves the system of congruences:

x congruent to a (modulo m)

and x congruent to b (modulo n).

I was told this shouldn't be hard but I'm personally struggling!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!