Siamese Multiples

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.

Problem information

Author: ProAl1 professors

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

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