Magic Squares
시간 제한: 2000ms메모리 제한: 512MB출처: CCC 2016 JuniorBOJ 14039
문제
Magic Squares are square arrays of numbers that have the interesting property that the numbers in each column, and in each row, all add up to the same total.
Given a 4 × 4 square of numbers, determine if it is magic square.
입력
The input consists of four lines, each line having 4 space-separated integers.
출력
Output either magic if the input is a magic square, or not magic if the input is not a magic square.
예제
예제 1
입력
16 3 2 13 5 10 11 8 9 6 7 12 4 15 14 1
출력
magic
예제 2
입력
5 10 1 3 10 4 2 3 1 2 8 5 3 3 5 0
출력
not magic
코드를 제출하려면 로그인하세요.