You are not logged in. Please login at to post your questions!


cf 447 div2 Ralph And His Magic Field

i have understood the formula for it but i am unable to understand that when k=-1 and n and m have different parity the answer will be -1 but for k=1 answer will not be -1 why? problem

asked 20 Nov '17, 22:42

anno's gravatar image

accept rate: 12%

edited 20 Nov '17, 22:43

This comment shall answer your question.


answered 20 Nov '17, 23:04

rajashekar007's gravatar image

accept rate: 0%

if we multiply all rows's product then they should be equal to multiplication of all element in the matrix same for columns. if n and m have different parity lets say n is even and m is odd then when we multiply all row's product we get even number because each row's product is equal to -1 but when we multiply all column's product then we get odd number but both should be equal to multiplication of all elements in the matrix that's why for k=-1 if n and m have different parity then solution does not exist....


answered 24 Nov '17, 00:56

shivam9654's gravatar image

accept rate: 0%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 20 Nov '17, 22:42

question was seen: 508 times

last updated: 24 Nov '17, 00:56