WTF, lol, How is this problem 2000 difficulty? https://codeforces.com/problemset/problem/1919/H
WTF, lol, How is this problem 2000 difficulty? https://codeforces.com/problemset/problem/1919/H
Let $$$m$$$ be some positive integer (not necessary prime) . There is a way to calculate $$$\displaystyle{\frac{a}{b}}\%m$$$ when b is not very big and $$$a \% b = 0$$$ Firstly, let's notice, that $$$\displaystyle{\frac{a}{b}}=mk+(a/b)\%m$$$, for some integer value k. Now, let's do some mathematical stuff:
So, the answer is $$$(a\%mb)/b$$$