Masala #1086
Matritsadagi eng katta + (plus)
Sizga N soni beriladi. Siz shunday NxN matritsa yaratishingiz kerakki, bu matritsa faqat 0 va 1 lardan tashkil topishi kerak. 0 lar turgan joylarni bo`yalmagan, 1 lar turgan joylarni bo`yalgan deb tasavvur qilaylik. Sizdagi bo`yoq 2xN dan ortiq kataklarni bo`yashga yetmasligini inobatga olgan holda, shu matritsada bo`lishi mumkin bo`lgan eng katta + (plus) shaklini chiqaring.
INPUT.TXT kirish faylida yagona butun son, \(N(2 \le N\le 2500)\) soni kiritiladi.
OUTPUT.TXT faylida shartlarni qanoatlantiradigan NxN matritsani chop eting, agar bunday matritsa mavjud bo`lmasa, −1 chiqaring.
# | input.txt | output.txt |
---|---|---|
1 |
2 |
-1 |
2 |
3 |
0 1 0 1 1 1 0 1 0 |
3 |
7 |
0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1 1 1 1 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 |
+ (plus) shaklining to`rtta uchi ham matritsa chegarasida bo`lishi lozim.