Minimize Digit Sum codechef

Minimize Digit Sum codechef solution Let f(n,B)f(n,B) be the sum of digits of the integer nn when written in base BB. Given QQ queries, each consisting of three integers n,ln,l and rr. Find the value of BB corresponding to which f(n,B)f(n,B) is minimum for all l≤B≤rl≤B≤r. If there are multiple such values, you can print any of them. Input Format The first line contains in…

Read More