GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Friday, 8 July 2022

[Solution] Journey of the Knight CodeChef Solution 2022


Chef has an 8×8 chessboard. He placed a knight on the square (X1,Y1). Note that, the square at the intersection of the ith row and jth column is denoted by (i,j).

Chef wants to determine whether the knight can end up at the square (X2,Y2) in exactly 100 moves or not.

For reference, a knight can move to a square which is:

  • One square horizontally and two squares vertically away from the current square, or
  • One square vertically and two squares horizontally away from the current square
Solution Click Below:-  👉CLICK HERE👈
👇👇👇👇👇


A visual description of this may be found here.

Input Format

  • The first line contains a single integer T — the number of test cases. Then the test cases follow.
  • The first and only line of each test case contains 4 integers X1,Y1,X2,Y2 — where (X1,Y1) denotes the starting square of the knight and (X2,Y2) denotes the ending square of the knight.

Output Format

For each test case, output YES if knight can move from (X1,Y1) to (X2,Y2) in exactly 100 moves. Otherwise, output NO.

Bidding CodeChef Solution 

Pass the Exam CodeChef Solution

Chef and Candies CodeChef Solution

Journey of the Knight CodeChef Solution

Slow Solution CodeChef Solution 

Game of Piles Version 1 CodeChef Solution

Find A, B, C CodeChef Solution

Largest Square in the garden CodeChef Solution

Game of Piles Version 2 CodeChef Solution


You may print each character of YES and NO in uppercase or lowercase (for example, yesyEsYes will be considered identical).

Constraints

  • 1T1000

No comments:

Post a Comment