Here is my code, all the testcase is passed except lastone . Can you tell what is wrong in my code?
Doubt reagarding primality testing question
Your logic is Correct.
This problem has week and improper test cases.
You can see this code ,in wich some libraries are used: https://ide.codingblocks.com/s/57850
Can you explain the logic behind this? My logic is miller rabin primality test
This is the school method. we have already checked for 3 and 2 and started with 5 and inside that checking for i and i+2 ,so all the cases cover and next checked no will start itself after adding 6,do dry run and you will find that in between i to i+6 all cases are allready handeled.
https://ide.codingblocks.com/s/447018 Here is my code for miller rabin and when i submit that question it failed on last testcase but when i open input from editorial section then my code passes all the input and meet the result with required output.