eolymp
bolt
Try our new interface for solving problems
Məsələlər

Prime Substring

Prime Substring

Given a string of digits, your task is to find the largest prime number which presents in that string. Our prime numbers are values between \textbf{2} to \textbf{100000} only. \InputFile Each line contains a string of digits (\textbf{255} digits at most). The line contains only \textbf{0} indicates the end which will not be processed. The input does not exceed \textbf{1000} lines. \OutputFile Print out in each line the largest prime number found in each input string.
Zaman məhdudiyyəti 10 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB
Giriş verilənləri #1
11245
91321150448
1226406
0
Çıxış verilənləri #1
11
1321
2
Mənbə ACM-ICPC Asia Hatyai Regional Programming Contest – November 16, 2012 – PSU, Hatyai