Circle of primes X49432


Statement
 

pdf   zip

html

Input The input will consist of two lines. The first line will be the number of centrifuges that need to be discharged. The input will consist of two lines. The first line will be the number of centrifuges that need to be discharged. The second line will have as many numbers as centrifuges indicated in the first line. The numbers in the second line will be the number of containers needed for each centrifuge (so the number of elements in the circle when playing the game).

Output The output should be a line for each centrifuge indicating whether all the containers in the circle will be prepared or not. And, in the latter case, a sentence telling the positions of the containers that won’t be prepared.

If the circle can be filled the line will state: "The circle can be completed". Idf the circle cannot be filled the line will state: "The circle cannot be completed. Container/s X,Y,Z, won’t be prepared.", being X,Y,Z,A,B... the numbers of the containers that will be never be filled.

Public test cases
  • Input

    3
    5 9 17
    

    Output

    The circle can be completed.
    The circle cannot be completed. Container/s 6, won't be prepared.
    The circle can be completed.
    
  • Input

    2
    22 23
    

    Output

    The circle cannot be completed. Container/s 4, 6, 8, 10, 12, 14, 16, 18, 20, won't be prepared.
    The circle can be completed.
    
  • Information
    Author
    HP CodeWars
    Language
    English
    Official solutions
    Python
    User solutions
    C++ Python