#include <stdio.h>
#include <math.h>

int main() {
    int n, i, j;
    int trace = 0;
    double norm = 0.0;

    printf("Enter the size of the square matrix: ");
    scanf("%d", &n);

    int matrix[n][n];

    printf("Enter the elements of the matrix:\n");
    for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) {
            scanf("%d", &matrix[i][j]);
        }
    }

    // Calculate trace and norm
    for (i = 0; i < n; i++) {
        trace += matrix[i][i]; // sum of principal diagonal elements
        for (j = 0; j < n; j++) {
            norm += matrix[i][j] * matrix[i][j]; // sum of squares of elements
        }
    }

    norm = sqrt(norm); // Square root of sum of squares

    printf("Trace of the matrix: %d\n", trace);
    printf("Norm of the matrix: %.2f\n", norm);

    return 0;
}

