import java.util.Arrays;

public class mc_q08
{
    public static int[] operation(int[][] m, int r, int c)
    {
	int[] result = new int[m.length];

	for (int j = 0; j < m.length; j++)
	    result[j] = m[r][j]*m[j][c];

	return result;
    }

    public static void main(String[] args)
    {
	int[][] mat = {	{3, 2, 1, 4},
			{1, 2, 3, 4},
			{2, 2, 1, 2},
			{1, 1, 1, 1}};

	int[] arr = operation(mat, 1, 2);

	System.out.println( Arrays.toString(arr) );
    }
}
