Siamese Multiples X85826


Statement
 

pdf   zip

html

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

Siamese multiples of n 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 n, 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 n 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