Logo
(追記) (追記ここまで)

19202번 - Elegant Square 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB64241538.462%

문제

Many people know about magic squares --- squares that contain distinct numbers and have equals sums of rows and columns. Recently Eve has heard about magic squares, and now she has invented her own version: elegant squares.

Eve calls a square of $n\times n$ integers elegant if the following conditions are satisfied:

  • All entries of the square are distinct positive integers.
  • All integers are square free. That means that no integer is divisible by $t^2$ for any $t > 1$.
  • The product of numbers in any row and any column is the same.

For example, the picture below shows an elegant 3ドル \times 3$ square.

$$ \begin{matrix} 1& 21& 10\\ 6& 5& 7\\ 35& 2& 3 \end{matrix} $$

All of its entries are distinct positive square free integers, and product of any row and any column is 210.

Help Eve, find an $n \times n$ elegant square. All numbers in the square must not exceed 10ドル^{18}$. It is guaranteed that for the given constraints there exists such square.

입력

The input file a single integer $n$ (3ドル \le n \le 30$).

출력

Output $n \times n$ integers: the found elegant square. All printed integers must not exceed 10ドル^{18}$.

제한

예제 입력 1

3

예제 출력 1

1 21 10
6 5 7
35 2 3

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2015 > Day 8: Andrew Stankevich Contest 47 E번

Contest > Open Cup > 2014/2015 Season > Stage 7: Northern Grand Prix E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /