Sum of GCDs of each row of the given matrix
Given a matrix mat[][] of size N * N, the task is to find the sum of GCDs of all the rows of the given matrix. Examples: Input: arr[][] = { {2, 4, 6, 8}, {3, 6, 9, 12}, {4, 8, 12, 16}, {5, 10, 15, 20}}; Output: 14 gcd(2, 4, 6, 8) = 2 gcd(3, 6, 9, 12) = 3 gcd(4, 8, 12, 16) = 4 gcd(5, 10, 15, 20) = 5