#include long SearchPrimeNumber(long); void main(void) { long l, h, i; long primeSmallNumber, smallFactor = 0, targetNumber = 1; scanf("%ld %ld", &l, &h); for (i = l; i <= h; i++) { primeSmallNumber = SearchPrimeNumber(i); if (smallFactor <= primeSmallNumber) { smallFactor = primeSmallNumber; targetNumber = i; } } printf("%ld\n", targetNumber); } long SearchPrimeNumber(long number) { long i; for (i = 2; i < number; i++) if (number%i == 0) break; if (i == number) i = 0; return i; }