Coding Practice with Kick Start Session - Sample Problem
Problem You have gathered N N bags of candy and you want to distribute the candy amongst M M kids. The i i -th bag contains C i C i pieces of candy. You want to make sure that every kid get the same amount of candy and that the number of pieces of candy they receive is the greatest possible. You can open each bag and mix all pieces of candy before distributing them to the kids. How many pieces of candy will remain after you share the candy amongst kids, based on the rules described above? Input The first line of the input gives the number of test cases, T T . T T test cases follow. Each test case consists of two lines. The first line of each test case contains two integers: integer N N , the number of candy bags, and M M , the number of kids. The next line contains N N non-negative integers C 1 , C 2 , … , C N C 1 , C 2 , … , C N representing array C C , where the i i -th integer ...