After getting a tip-off from a myseterious online source, Jiahai the Potato has discovered a dangerous conspiracy against him. He has also discovered a map of a group of land mines laid outside his potato farm. Since the potatoes who conspired against him still need to walk through the minefield, some of the mines are active while some are not.
Jiahai the Potato has grown up, and is now walking out of the minefield into the woods. However, there is a problem. The map showing the mines only indicate an integer label on each of the mine. The mine is active if the integer has no more than two factors. Given the integer on the mine label, help Jiahai the Potato determine if the mine is active.
Your program should implement the following functions:
- bool isActive(long long int N), which should return "True" if the mine is active and "False" if the mine is not.
For all subtasks: isActive()
can be called at most 1 000 000 times.
Subtask 1 (18%): 1 <= N
<= 1 000 (randomly generated)
Subtask 2 (34%): 1 <= N
<= 1 000 000 (randomly generated)
Subtask 3 (47%): 1 <= N
<= 1 000 000 000 (randomly generated)
Bonus Subtask 4 (1%): 1 <= N
<= 1 000 000 000 (These are generated by Rar the Cat. Good luck.)
Sample Input 1
2 5 9
Sample Output 1
1 1 0