Company: MAQ
Difficulty: medium
Christmas Celebration Today is Christmas, and as a teacher, you need to distribute gifts among your students. You have n boxes of chocolates and there are x number of students in the class. You need to distribute gifts among the students in such a way that each gift consist of exactly two boxes in such a way that the count of chocolates in a gift can be uniformly distributed among all the students i.e. count of chocolates in the gift is divisible by the number of students in the class. Your task is to find the total number of chocolate boxes their teacher can take to form the gifts. Note: Each box cannot be a part of more than one gift and also the teacher cannot use a box partially. Input Format First line: T (Number of test cases) The first line of each test case consists of n number of chocolate boxes and x number of students in the class The second line of each test case contains n integers a 1 , a 2 , ..., a n (1 ≤ a i ≤ 10 5 ) where a i represent the count of chocolates in the it