Count Solutions Of ax ≡ b (mod m)
Computer Mathematics
Hard
3 views
Problem Description
Count how many x in [0..m-1] satisfy ax ≡ b (mod m).
Input Format
Three integers a b m.
Output Format
One integer count.
Official Solution
Let g=gcd(a,m). If b%g!=0 then 0. Else there are g solutions.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!