## Minimize Digit Sum codechef solution long challenge 100% correct 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 Minimize Digit Sum solution codechef The first line contains in single integer QQ, the … Read more