Satyam the Dancer - B

0

0 votes
Medium
Problem

Satyam is so obsessed with dancing that he can dance with anything. Today he is dancing with a matrix of dimensions N by N where a[i][j] is defined by the following equation:

    a[i][j] = ((i)^j)%17    where x^y is equivalent to x raised to the power y

where i and j indices of the matrix follows 1-based-indexing.

Here are his dance moves:

  1. You are required to create two new matrices :

Matrix1 : each row should contain the cumulative sum of the corresponding row in the original matrix.

Matrix2 : each column should contain the cumulative sum of the corresponding column of the original matrix

  1. Now you need to print determinant of the product of matrix1 and matrix2.

Your Input : 5

NOTE You do not need to create a program for this problem you have to write your answers of given input in given code snippet

  • To see how to submit solution please check this link

Compile and Test can give Wrong Answer. Once you have written your answer, print Submit button to check your result.

Sample Input
2
Sample Output
4
Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

The matrix formed as per the equation is :

 1 1                1 1                   1 2    
 2 4                3 5                   2 6
Original            Matrix 1             Matrix 2

Product of the matrix :

3 8
13 36

Editor Image

?