Rosetta Problems

Primitive Root

https://judge.yosupo.jp/problem/primitive_root