Siamese Multiples

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.

Problem information

Author: ProAl1 professors

Generation: 2026-01-25T16:53:40.002Z

© Jutge.org, 2006–2026.
https://jutge.org