Company: Rapido_10oct
Difficulty: medium
Multiple Problem Description There are two boxes of chocolates. Alex's box holds A chocolates and Drake's box holds B chocolates. Drake is the younger child, and he is happy only if the number of chocolates he gets is a multiple of the number Alex gets. You decide to buy some extra chocolates to make him happy. You may put X extra chocolates into Alex's box and Y extra chocolates into Drake's box. Afterwards the boxes must satisfy k * (A + X) = B + Y for some non-negative integers X and Y and some positive integer k . The value k = 1 (both boxes end up equal) is allowed. The original chocolates cannot be moved from one box to the other, and no chocolate can be removed from a box. You can only add chocolates. Find the minimum total number of extra chocolates X + Y you need to buy. Complete the function solution(A, B) , which returns this minimum. Input Format The first line contains an integer A , the number of chocolates initially in Alex's box. The second line contains an integer B ,