Masala #ITGRU3AQTW

Xotira 16 MB Vaqt 1000 ms
14

Shashka o`yini va Zelishmalik

Bugun Zelishmalik shashka o`yinini oynashni organdi. Ustozi uni qay darajada o`rganganligini tekshirish maqsadida unga savol berdi “seni shashkani yurishga nechta variantin bor” dedilar. Siz Zelishmalikka yordam berolasmi.Yani shashkani yurishni nechta varianti bor.Zelishmalik faqat oq shashkada oynaydi.


Kiruvchi ma'lumotlar:

Sizga 8x8 olchamdagi shashka maydoni v au yerdagi shashkalarni turgan joylari beriladi.Oq rang bu 1, Qora rang esa 0 bo`ladi.


Chiquvchi ma'lumotlar:

Zelishmalikni nechta varianti bor ekanini toping.Agar shashka oyinidagi shashkalar xato bolsa ‘Error’ so`zini chop eting.


Misollar
# input.txt output.txt
1
. . . 0 . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . 1 . . . .
. . . . . . . .
2
2
. . . 0 . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . 1 . . . 1
. . . . . . . .
3
3
. . . 0 . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . 1 . . .
. . . . . . . .
. . . 1 . . . .
. . . . . . . .
Error
Izoh:

1-testda oq shashka 2 ta katakka yuroladi o`nggga va chapga oshani uchun 2 degan javob chiqardi.Orqaga olishi mumkin emas va damka yo`q.