Primes and moduli
Let
be the
th
prime number (starting at 0):
Define
as the remainder of
modulo
.
For instance,
,
because
Given two integer numbers
and
,
find the largest
such that
.
Input consists of several cases, each one with two integer numbers
and
,
where
and
.
Output
For every case, print the largest
such that
.
Author: Albert Graells
Generation: 2026-01-25T11:19:12.426Z
© Jutge.org, 2006–2026.
https://jutge.org