| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 11863 | 電機系 (資電館R406, R407) 上機考 |
|
Description
Determine whether a matrix contains at least one sequence that each preceding number is NOT a factor of its immediately successive number from the top-left corner to the bottom-right corner. Print Yes or No.
- Examples that a preceding number is a factor of its immediately successive number
- Examples that a preceding number is NOT a factor of its immediately successive number
- An exampling matrix that contains at least a valid sequence:
Hints:
- No need to print out the sequence.
- Each number can be reached by up to four directions.
- Matrices are consisted of 1~9.
- Matrix width and height < 100.
- The answers are the same no matter cycles are allowed or not in the sequences.
- Avoid your program from running into an endless cycle.
Input
Output
- Repeat all inputs.
- Additionally print Yes or No after each matrix.