kontenjeri
In each of three containers there is some amount of gray, green and white bottles that are about to be recycled. In order to recycle the glass, each of the three containers should contain the bottles of the same color.
Write a program that will find the minimal number of bottles that have to be moved (from a container to some other container) in order to have each of the three containers with only bottles of the same color.
InputFrom each of the first three lines of the standard input read three integers (from the interval [0 2^20]) that describe the contents of the three containers. In each line the three numbers represent the number of gray, green and white bottles.
OutputTo the standard output write one integer that represents the minimal number of bottles that have to be moved
Input:
Output:
1 2 3
4 5 6
7 8 9Output:
30Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.