def es_primo(n):
if n < 2:
return False
for i in range(2, int(n ** 0.5) + 1):
if n % i == 0:
return False
return True
def filtrar_primos(lista):
return [num for num in lista if es_primo(num)]
def main():
try:
# Leer la entrada y convertirla en lista de números
entrada = input().strip()
if not entrada: # Si no hay entrada, usa una lista por defecto
numeros = [2, 3, 4, 5, 10, 17, 19, 20, 23]
else:
numeros = list(map(int, entrada.split()))
# Imprimir los números primos encontrados
print("Números primos:", filtrar_primos(numeros))
except Exception as e:
print("Error:", e)
if __name__ == "__main__":
main()
ZGVmIGVzX3ByaW1vKG4pOgogICAgaWYgbiA8IDI6CiAgICAgICAgcmV0dXJuIEZhbHNlCiAgICBmb3IgaSBpbiByYW5nZSgyLCBpbnQobiAqKiAwLjUpICsgMSk6CiAgICAgICAgaWYgbiAlIGkgPT0gMDoKICAgICAgICAgICAgcmV0dXJuIEZhbHNlCiAgICByZXR1cm4gVHJ1ZQoKZGVmIGZpbHRyYXJfcHJpbW9zKGxpc3RhKToKICAgIHJldHVybiBbbnVtIGZvciBudW0gaW4gbGlzdGEgaWYgZXNfcHJpbW8obnVtKV0KCmRlZiBtYWluKCk6CiAgICB0cnk6CiAgICAgICAgIyBMZWVyIGxhIGVudHJhZGEgeSBjb252ZXJ0aXJsYSBlbiBsaXN0YSBkZSBuw7ptZXJvcwogICAgICAgIGVudHJhZGEgPSBpbnB1dCgpLnN0cmlwKCkKICAgICAgICBpZiBub3QgZW50cmFkYTogICMgU2kgbm8gaGF5IGVudHJhZGEsIHVzYSB1bmEgbGlzdGEgcG9yIGRlZmVjdG8KICAgICAgICAgICAgbnVtZXJvcyA9IFsyLCAzLCA0LCA1LCAxMCwgMTcsIDE5LCAyMCwgMjNdCiAgICAgICAgZWxzZToKICAgICAgICAgICAgbnVtZXJvcyA9IGxpc3QobWFwKGludCwgZW50cmFkYS5zcGxpdCgpKSkKICAgICAgICAKICAgICAgICAjIEltcHJpbWlyIGxvcyBuw7ptZXJvcyBwcmltb3MgZW5jb250cmFkb3MKICAgICAgICBwcmludCgiTsO6bWVyb3MgcHJpbW9zOiIsIGZpbHRyYXJfcHJpbW9zKG51bWVyb3MpKQoKICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToKICAgICAgICBwcmludCgiRXJyb3I6IiwgZSkKCmlmIF9fbmFtZV9fID09ICJfX21haW5fXyI6CiAgICBtYWluKCkK
Números primos: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41]