Untitled

mail@pastecode.io avatar
unknown
plain_text
17 days ago
1.2 kB
4
Indexable
Never
'use strict';

process.stdin.resume();
process.stdin.setEncoding('utf-8');

let inputString = '';
let currentLine = 0;

process.stdin.on('data', inputStdin => {
    inputString += inputStdin;
});

process.stdin.on('end', _ => {
    inputString = inputString.trim().split('\n').map(string => {
        return string.replace(/\s+/g, " ").trim();
    });
    main();
});

function readLine() {
    return inputString[currentLine++];
}

function readIntArr() {
    let str = readLine();
    str = str.split(" ");
    let arr = [];
    for ( let i = 0; i < str.length; i++ ) {
        arr.push(parseInt(str[i], 10));
    }
    return arr;
}

function print(x) {
    process.stdout.write(x + "");
}


/**
 * @param {number} n
 * @param {number[][]} matrix
 * @return {boolean}
 */


// TODO: Implement this method
function checkMagicSquare(n, matrix) {
}

// NOTE: Please do not modify this function
function main() {
    let n = parseInt(readLine(), 10);
    let matrix = [];
    for (let i = 0; i < n; i++) {
        matrix.push(readIntArr());
    }
    let result = checkMagicSquare(n, matrix);
    if (result == true) {
        console.log("Yes");
    }
    else {
        console.log("No");
    }
}
Leave a Comment