I've been trying to solve this problem — 385C - Bear and Prime Numbers , Bear and Prime Numbers. My solution gives a completely expected runtime error on Testcase#4. Can someone please explain to me as to why this is happening?
Any help would be greatly appreciated.
Thanks in advance.
EDIT: Solved. I had not taken into consideration that even l could be greater than 10000000.