Computer Science, asked by keepintouchb, 8 months ago

3. Number Distancing Problem Description Consider 9 natural numbers arranged in a 3x3 matrix: n11 n12 n13 n21 n22 n23 n31 n32 n33 Define numbers "in contact" with a given number to be those that appear closest to it on the same row, column or diagonally across: Contacts of number n11: n12, n22 and n21 Contacts of number n12: n11, n21, n22, n23, n13 Contacts of number n13: n12, n22, n23 Contacts of number n21: n11, n12, n22, n32, n31 Contacts of number n22: n11, n12, n13, n23, n33, n32, n31, n21 Contacts of number n23: n13, n12, n22, n32, n33 Contacts of number n31: n21, n22, n32 Contacts of number n32: n31, n21, n22, n23, n33 Contacts of number n33: n32, n22, n23 The problem now is that numbers having a common factor (other than 1) should not be "in contact". In other words, a pair of numbers can remain neighbours only if their highest common factor is 1. The following rules apply to enforce this "distancing": 1. The central number (n22) stays put. 2. The corner numbers (n11, n13, n33, n31) can move in the same row or column or diagonally away from the centre. 3. The numbers "on the walls" (n12, n23, n32, n21) can only move from the walls i.e. n21 can only move "left", n12 can only move "up", n23 can only move "right" and n32 can only move "down". 4. Each number should stay put as far as possible and the "distancing" operation should result in the least number of numbers ending up without any contacts.

Answers

Answered by priyadpriyadarshini3
0

Answer:

First watch last and 1st box if they are same then your answer will be second box

Similar questions