
-----------------------------------
MysticVegeta
Thu Oct 20, 2005 2:01 pm

Programming Problem - Knight Move!
-----------------------------------
PS: This problem is made by me! No I dont know the solution. All Languages welcome.

A grid (x, y) represents the size of the chess board. A Knight is a piece of the chess board that only moves 21/2 steps. For Example, x marks the points where the knight moves. '0' represents his position

.X.X
X...
..0.
X...

A knight when placed in the centre of a 8 X 8 board moves in 8 directions

1) 2 steps up and 1 right
2) 2 steps up and 1 left
3) 2 steps down and 1 right
4) 2 steps down and 1 left
5) 1 step left and 2 up
6) 1 step left and 2 down
7) 1 step right and 2 up
8) 1 step right and 2 down

Your job is to calculate the minimum number of moves requried for the Knight to complete his travel on all the squares.

Input: The first line will contain the X coordinate, Y coordinate where 
          x, y >= 4, x = y. separated by commas

Output : The minimum number of moves required for the knight to  complete his travel

Sample Input
4, 4
8, 8

Any programming language is available

Problem copyright by me

-----------------------------------
Mazer
Thu Oct 20, 2005 4:58 pm


-----------------------------------
What's the second line? And why bother listing x and y if, as you said, x = y?

Also, this should probably be in the contests section.

-----------------------------------
Blade
Fri Oct 21, 2005 2:46 am


-----------------------------------
man, i was totally assigned that problem 2 years ago for grade 12 programming at east elgin in aylmer ontario... i dont think i have the turing file anymore but i remember i used recursive functions to solve it.

-----------------------------------
zylum
Sun Oct 23, 2005 9:07 pm


-----------------------------------
here's a better one i came up with:

You are to find the fewest number of moves a knight must make to capture 0  < p 