# c++ program which can take generic inputs

9 natural numbers arranged in a 3x3 matrix: n11 n12 n13 n21 n22 n23 n31 n32 n33 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

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 [login to view URL] to enforce "distancing": 1. The central number (n22) stays put. 2. The corner numbers (n11, n13, n33, n31) can move in same row or column or diagonally away from 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. 5. After satisfying rule 4, if there are multiple options for the final matrix, then the "distancing" operation should result in the smallest (m x n matrix, including the intervening blank space elements, with the least possible value of m*n). 6. If, after satisfying all the rules above, there are multiple distancing options for a set of numbers, the largest num keeps its cell. Constraints 1 <= Element of grid <= 100 Input First line consists of 9 space separated integers denoting n11, n12, n13, ... n23, n33. Output Print the "contact" less numbers in ascending order of their value separated by space. Output "None" if there are no such numbers. Ex1

Input 23 33 12 1 2 5 25 6 10

Output 10

Explanation Initial configuration 23 33 12 1 2 5 25 6 10 The optimal distancing options result in the following possibility (space denoted by *): 23 33 * 12 1 2 5 * 25 * * * * 6 * 10 10 ends up as the number without contacts.

Tietoa työnantajasta:
( 0 arvostelua ) Bengaluru, India

Projektin tunnus: #26907161

## Myönnetty käyttäjälle:

rizzzak

Hi, pretty interesting work, i already worked with maths/statistics tasks(you can see them in profile) and is interested in this task. Will do it asap because i need good rating on this service, if you'll choose me.

₹800 INR 3 päivässä
(1 arvostelu)
0.7

## 5 freelanceria on tarjonnut keskimäärin ₹2230 tähän työhön

popularcontent12

i am c++ developer ping me I am a software and Web Developer. I hava also lot of experience in Designing. I have some rules and regulations before start of project: 1. Provide 100% work within deadline. 2. Provide un Lisää

₹5000 INR 1 päivässä
(14 arvostelua)
3.9
chbhanuprakash

I have gone through the question and i have got the solution. Contact me for details. ACM ICPC Regionls ranked under 20. 5 star rating in Codechef. Expert Level in Codeforces. 1st in Inter Nit coding contest. I can i Lisää

₹1500 INR 1 päivässä
(3 arvostelua)
2.3
Automation0065

Dear, Hope you will be doing well. We are working as a firm. We are equipped with a team from very diverse background. i.e., Engineers, Programmers, Circuit Designers, App Developers, Machine Learning Expert, AutoCAD E Lisää

₹3000 INR 7 päivässä
(0 arvostelua)
0.0
skc8981416182

Hii, I am a computer engineer. I can do it perfectly. Specifically I do this work 1 month ago. I think I can fulfill your requirements. For contact email me. Thank you

₹850 INR 1 päivässä
(0 arvostelua)
0.0