Search found 1 match

by putput
Tue Jun 20, 2006 12:03 pm
Forum: Volume 6 (600-699)
Topic: 696 - How Many Knights
Replies: 29
Views: 16562

hi, as far as i can tell your M or N = 2 part is wrong

else if(m==2 || n==2)
{
if(m<n)
num=2*(n/2 + 1);
else
num=2*(m/2 + 1);
}

let's use some easy samples

2x2
2x4

2 x 2
num = 2*(2/2 +1) = 4 this one is correct!

2 x 3
num = 2*(4/2 +1) = 6 <-- WRONG!

point is in a 2 x X board you can ...

Go to advanced search