https://www.codechef.com/ACD2019/problems/DIV1

See e.g. here and the couple of posts after it.

1 Like