All submissions for this problem are available.
has played a standard chess. Ram and sham play a modified version of chess
where the field is not 8x8 but an NxN.
There is one king, N Knights and N-1 queens. At a particular move Ram wishes to
know the total number of possible safe moves he can do.
move is defined as a move where, the new place of move is either not under an
attack of opponent’s pieces or if both players attack the same place will lead
to less(not equal) loss of Ram as compared to Sham.
is defined as
should not be attacked.
Attack on opponent’s king is not a safe move.
other rules of general chess are followed.
Inpu may contain multiple test cases.
line contain the Size of field N, Assume N to be below 13
line contain number of knights n(<=N) and number of
Queens m(<=N-1) separated by a space
lines will contain 2 integers each, x,y
i.e. location of knights
lines will contain 2 integers each x,y
i.e. location of Queens
line will be the location of king x,y.
are for the opponents pieces.
Single line containing number of safe moves. Print
NONE if no such move exists.
Explanation of output 1
move only to 3,2
can move 3,3
loss->1 opponent loss->2
can move 1,2 , 3,1
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.