HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN_114 Midterm B > problem:


10. 51095 - Normal and Trace

CEN_114 Midterm B

Start: May.14.2020 at 12:00:01 AM
Finish: May.31.2020 at 11:59:59 PM
The contest is finished!
• Contest scoreboard

Contest problems

• 10. 51095 - Normal and Trace
• 11. 51089 - Multiply a row and add i...
• 12. 50749 - Min Distance
• 13. 51124 - Easy Tiae words
• 14. 51136 - Class Average 2
• 15. 50734 - Product Info (In Srt)
• 2. 50453 - The Cubic Difference
• 3. 50346 - The Biggest Date
• 5. 50380 - Sum of the Numbers in t...

Feedback

If you notice incorrect translations in Contester, please let author know.

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
Для отправки решений необходимо выполнить вход.

www.contester.ru