1424 - DS_18_CHEN_quiz1 Scoreboard

Time

2018/04/02 18:30:00 2018/04/02 20:30:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
11865 Number Maze

11865 - Number Maze   

Description

Determine whether a matrix contains at least one sequence that
  • each preceding number is NOT a factor of its immediately successive number
    • EX: 1->3 (X)
    • EX: 2->6 (X)
    • EX: 3->3 (X)
    • EX: 3->1 (O)
    • EX: 3->4 (O)
  • from the top-left corner to the bottom-right corner

         ​

  • Each number can be reached by up to four directions
  • Matrices are consisted of 1~9
  • Matrix width and height < 100

Input

The first number is the total number of matrices.

The second and third numbers are the width and height of the first matrix.

Then the first matrix is listed.

So on and so forth.

Output

Repeat all inputs.

Additionally print Yes or No

※There is no white space after last element in each line of matrix.

Sample Input  Download

Sample Output  Download

Tags




Discuss