"Title description"
Rabin-miller algorithm.
"Input description"
First line: CAs, representing the number of data groups (CAS <= 350), the following CAS lines, one number per line, guaranteed to be within a 64-bit long shaping range, and no negative numbers. You need for each number:
First, test whether it is prime, prime
Second, if it is not prime, which number is the maximum quality factor of the output.
"Output description"
The first line of CAS (CAS <= 350, which represents the number of groups of test data).
The following CAS lines: one digit per line, guaranteed to be a positive number within the 64-bit long shaping range.
For each set of test data: The output prime, which represents it as a prime number, or the output of its largest mass factor, represents it as number and number.
"Input Sample"
6
2
13
134
8897
1234567654321
1000000000000
"Output Example"
Prime
Prime
67
41
4649
5
"Data range and Tips"
Guarantee CAs <= 350 to ensure that all numbers are within the 64-bit long range.
Rabin-miller algorithm