Skip to main content
Rollback to Revision 3
Source Link
Todd Trimble
  • 53.3k
  • 6
  • 205
  • 322

The problem is from contest.Please flag it for removing it Given $N$ integers on a circle, how to choose them in pairs to obtain minimum sum?

(Added by YCor 2019 July 7): it has been mentioned in the comments that this is part of a contest "Circular merging, July Challenge 2019 Division 1", where an equivalent question (just more clearly phrased) is asked here.

Problem$N$ integers $A_1,A_2,A_3....A_N$ are arranged on a circle such that $A_i$ is adjacent to $A_{i+1}$. Also $A_N$ is adjacent to $A_1$. We can choose two adjacent integers (say $A_j$, $A_{j+1}$) and keep integer with value $A_j+A_{j+1}$ in between them on the circle. Then we can remove $A_j$, $A_{j+1}$ from contestthe circle.Please flag it for removing it We can keep doing this until one integer is left on circle i.e. total $N-1$ times. We need to minimise the sum of numbers that we added on the circle.

Example: $20,10,3$ (as sequence) are arranged on the circle. Then first we can choose $10,3$. Now the sequence becomes $20,13$. Then we choose $20,13$ and final sequence becomes $33$. Hence the sum of numbers that we added on circle is $13 + 33 = 46$. https://www.codechef.com/JULY19A/problems/CIRMERGEThis is the minimum sum possible. What will be the general procedure to solve this problem ?

The problem is from contest.Please flag it for removing it

Problem is from contest.Please flag it for removing it. https://www.codechef.com/JULY19A/problems/CIRMERGE

Given $N$ integers on a circle, how to choose them in pairs to obtain minimum sum?

(Added by YCor 2019 July 7): it has been mentioned in the comments that this is part of a contest "Circular merging, July Challenge 2019 Division 1", where an equivalent question (just more clearly phrased) is asked here.

$N$ integers $A_1,A_2,A_3....A_N$ are arranged on a circle such that $A_i$ is adjacent to $A_{i+1}$. Also $A_N$ is adjacent to $A_1$. We can choose two adjacent integers (say $A_j$, $A_{j+1}$) and keep integer with value $A_j+A_{j+1}$ in between them on the circle. Then we can remove $A_j$, $A_{j+1}$ from the circle. We can keep doing this until one integer is left on circle i.e. total $N-1$ times. We need to minimise the sum of numbers that we added on the circle.

Example: $20,10,3$ (as sequence) are arranged on the circle. Then first we can choose $10,3$. Now the sequence becomes $20,13$. Then we choose $20,13$ and final sequence becomes $33$. Hence the sum of numbers that we added on circle is $13 + 33 = 46$. This is the minimum sum possible. What will be the general procedure to solve this problem ?

Post Undeleted by Todd Trimble
Post Deleted by Todd Trimble

Problem is from contest.Please flag it for removing it. https://www.codechef.com/JULY19A/problems/CIRMERGE

Problem is from contest.Please flag it for removing it

Problem is from contest.Please flag it for removing it. https://www.codechef.com/JULY19A/problems/CIRMERGE

Problem is from contest
Source Link

Given $N$ integers on a circle, how to choose them in pairs to obtain minimum sum? The problem is from contest.Please flag it for removing it

(Added by YCor 2019 July 7): it has been mentioned in the comments that this is part of a contest "Circular merging, July Challenge 2019 Division 1", where an equivalent question (just more clearly phrased) is asked here.

$N$ integers $A_1,A_2,A_3....A_N$ are arranged on a circle such that $A_i$ is adjacent to $A_{i+1}$. Also $A_N$ Problem is adjacent to $A_1$. We can choose two adjacent integers (say $A_j$, $A_{j+1}$) and keep integer with value $A_j+A_{j+1}$ in between them on the circle. Then we can remove $A_j$, $A_{j+1}$ from the circle. We can keep doing this until one integer is left on circle i.e. total $N-1$ times. We need to minimise the sum of numbers that we added on the circle.

Example: $20,10,3$ (as sequence) are arranged on the circle. Then first we can choose $10,3$. Now the sequence becomes $20,13$. Then we choose $20,13$ and final sequence becomes $33$. Hence the sum of numbers that we added on circle is $13 + 33 = 46$. This is the minimum sum possiblecontest. What will be the general procedure to solve this problem ?Please flag it for removing it

Given $N$ integers on a circle, how to choose them in pairs to obtain minimum sum?

(Added by YCor 2019 July 7): it has been mentioned in the comments that this is part of a contest "Circular merging, July Challenge 2019 Division 1", where an equivalent question (just more clearly phrased) is asked here.

$N$ integers $A_1,A_2,A_3....A_N$ are arranged on a circle such that $A_i$ is adjacent to $A_{i+1}$. Also $A_N$ is adjacent to $A_1$. We can choose two adjacent integers (say $A_j$, $A_{j+1}$) and keep integer with value $A_j+A_{j+1}$ in between them on the circle. Then we can remove $A_j$, $A_{j+1}$ from the circle. We can keep doing this until one integer is left on circle i.e. total $N-1$ times. We need to minimise the sum of numbers that we added on the circle.

Example: $20,10,3$ (as sequence) are arranged on the circle. Then first we can choose $10,3$. Now the sequence becomes $20,13$. Then we choose $20,13$ and final sequence becomes $33$. Hence the sum of numbers that we added on circle is $13 + 33 = 46$. This is the minimum sum possible. What will be the general procedure to solve this problem ?

The problem is from contest.Please flag it for removing it

Problem is from contest.Please flag it for removing it

mentioned contest
Source Link
YCor
  • 63.9k
  • 5
  • 187
  • 286
Loading
formatting, added tag
Source Link
YCor
  • 63.9k
  • 5
  • 187
  • 286
Loading
Post Undeleted by YCor, Jeremy Rickard, Francois Ziegler
Post Deleted by user142755
Source Link
user142755
user142755
Loading