Find min k.

Revision en1, by __LAKSHAY__, 2023-04-16 16:49:33

In google farewell round B I was solving 2nd problem and stuck at the part where I need to find min k for which : (k*d)%n = x where d<=n-1 and n<=1e9. Can any one tell how to find it in optimal way. Thank in advance!

Tags number theory

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English __LAKSHAY__ 2023-04-16 16:49:33 228 Initial revision (published)