Given a big integer number, you are required to find out whether it’s a prime number.
Input
The first line contains the number of test cases T (1 <= T <= 20 ), then the following T lines each contains an integer number N (2 <= N < 2 54).
Output
For each test case, if N is a prime number, output a line containing the word “Prime”, otherwise, output a line containing the smallest prime factor of N.
Sample Input
2
5
10
Sample Output
Prime
2
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <algorithm>
typedef long long ll;
#define Time 15 //随机算法判定次数,Time越大,判错概率越小
using namespace std;
ll n,ans,factor[10001];//质因数分解结果(刚返回时是无序的)
ll tol;//质因数的个数,数组下标从0开始
//****************************************************************
// Miller_Rabin 算