
Fax McClad, Croneria's most curious bounty hunter, is interested in certain numbers.
A number is called a palindrome if it is the same when read left-to-right or right-to-left. For example,
Fax also loves the number
Fax is interested in the palindromes that are divisible by
Input Specification
The first line of input will contain
The
For
For an additional
Output Specification
On separate lines, print the answer to each query.
Sample Input
2 2
10 50
100 300
Sample Output
2
10
Explanation for Sample Output
For the first query,
Comments
Would Anyone be so kind and give me some tips on my code?
https://dmoj.ca/submission/2609021
Im struggling on passing batch 4 test case 13.
Thanks!
You are looping through every element in
array
and breaking when an element is larger thanM
(the upper bound). Sincearray
is sorted in your code, think of a searching technique that is more efficient than a linear scan.