Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. bfs.
Normal and Trace
Question: Given a 2D square matrix, the task is to find Normal and Trace of matrix.
Normal of a matrix is defined as square root of sum of squares of matrix elements.
Trace of a n x n square matrix is sum of diagonal elements
Input specification: In the first line you will be given one integer number (1<=n<=500) the dimension of matrix, then in following n lines you will be given a square matrix size of n by n, where each element of matrix is in reange 1 to 100
Output specification: Show Normal with two digits after the floating point and Trace of matrix .
Sample Input I
3 6 3 2 5 2 4 1 2 4
|
Sample Output I
10.72 12
|
Sample Input I Explanation
Normal= sqrt(6*6+3*3+2*2+5*5+2*2+4*4+1*1+2*2+4*4)=10.72
Trace=6+2+4=12 Для отправки решений необходимо выполнить вход.
|