This is yet another program to answer a problem in a book called algorithms.Here's the problem: 17. A King's Reach (a)The king in chess can move to any neighboring square horizontally,vertically, or diagonally.Assuming that the king starts on some square of an infinite chessboard, in how many different squares can it be after n moves. (b)Answer the same question if the king makes no diagonal moves.