Let us categorize both searches as Search 1 and Search 2
In search 1: total items = n,
maximum # of items displayed on one page = 12 and # of items on the last page = X
Thus, it can be written as
n= 12 p + X (here, p = number of pages with the max. # of items displayed is 12)
This equation seems familiar as a remainder equation, where the question would have been :
when n is divided by 12, the remainder is X and the quotient is p.thus, we know that in remainder<divisor always, hence, here, X<12
That leaves us with option 1, 5 and 7 for X
n= 12p+1 => n = 13, 25, 37, 49, 61...
n= 12p+5 => n= 17, 29,
41, 53,
65...
n= 12p+7 => n= 19, 31, 43, 55, 67...
In search 2: total items = n,
maximum # of items displayed on one page = 24 and # of items on the last page = Y
Thus, it can be written as
n= 24q + Y (here, q = number of pages with the max. # of items displayed is 24)
In line with the reasoning above, we have Y<24
let's check for Y = 17 or 12
n= 24q+12 => 36, 60,...
n= 24q+17 =>
41, 65,...
Thus, X= 5 and Y= 17.