Home > Back-end >  How to solve the problem with the python language?
How to solve the problem with the python language?

Time:03-20

A kindergarten, there are five children in a circle, their Numbers for 1, 2, 3, 4, 5. They have a number of candy, a candy game, now they do since 1 children, to divide three candy (if uneven candy, immediately to eat) yourself a copy of the rest of the two adjacent to his two children,
Then no. 2, 3, 4, 5 children do the same,
Asked after round, each kid hand how many sweets?
Input format
Enter the five elements, including five integers, representative before the game started, the number of each child in the hands of candy,

The output format
Output a line, five integers, separated by Spaces, respectively, after a number of candy each child,
Sample data
Enter
7
9
6
8
4
  • Related