I’m using the segmented sieve as suggested for this problem but I’m getting a WA for it; unfortunately I can’t look at the test cases so I don’t know which edge case I’m going wrong. I’ve tried the worst case input and it’s correct (low = 99999000, high = 100000000), for trivial solutions like (low = 1, high = 2), etc, but I’m not sure where I went wrong.
It seems I can’t upload my code as I’m a new user, so I’m linking it through IDEone.
I understand it looks like I’m not taking any effort, but I’m new to competitive programming; so even a nudge towards where I went wrong would help, I don’t mind non-direct answers. Any help would be much appreciated. Thanks in advance.
My code