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.
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 unlimited revisions until employee satisfy 100%
The area of experties are:
1. Java, JavaFX, JAVA( SWing), J2EE
2. PHP, HTML, CSS, BootStrap
3. MVC, C#, .NET
4. C/C++ Programming
5. Android Applications Developmet
My main target is provide you a 100% work within your deadline and low budget. You get a good result after
hiring me.
So click award button for more discussion. Thanks
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 implement the solution and give it you in an hour.
Get in touch for more details.
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 Experts, Data Entry boys etc.
After going through your project proposal, I want to let you know that we can help you with this project. We completed many such projects and will provide you with a quality work.
Please contact once for further discussion.
Thanks
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