Siamese Multiples X85826


Statement
 

pdf   zip

Write a program that reads a positive integer nn, followed by a sequence of positive integers. The program must report any siamese multiple of nn found in the sequence. A siamese multiple of nn is a number that is multiple of nn and ends in the same digit than nn.

Siamese multiples of nn found in the sequence are printed as output. At the end, the sum of all found siamese multiples is also printed.

If the sequence contains no siamese multiples of nn, the message "No siamese multiples were found" is printed.

Input

The input is a positive integer followed by a sequence of integers.

Output

The output is a message reporting each siamese multiple of nn found in the sequence (see message format in the examples below), or the message "No siamese multiples were found" if the sequence does not contain any number with the required properties.

Public test cases
  • Input

    6
    45 18 9 12 22 
    24 36 99 86 66 72

    Output

    Found a siamese multiple: 36
    Found a siamese multiple: 66
    Sum of siamese multiples: 102
    
  • Input

    23        12 78 92 46 121 212 9 253 128 88 201

    Output

    Found a siamese multiple: 253
    Sum of siamese multiples: 253
    
  • Input

    7
    21 49 63 14 27 112 999 127
    

    Output

    No siamese multiples were found
    
  • Information
    Author
    ProAl1 professors
    Language
    English
    Official solutions
    Python
    User solutions
    Python