https://liuxueyang.github.io/posts/codeforces/1916d/
CodeForces 1916D Mathematical Problem