@abhishek_trigunait and @O17LPOLC0033 I am trying to solve this problem using segmented sieve concept but still i am getting tle . https://ide.codingblocks.com/#/s/16457
https://online.codingblocks.com/player/2872/content/1038?tab=submissions
could you pleasse suggest whats wrong in the code .