Prime visits Problem

why its showing error… I checked all the test cases and run the program in online compile its showing same answer as in the output test case. Plus I didn’t understand the solution u gave on the editorial.

@minal.251298
Share your code here using cb.lk/ide so I can have a look.