#ifndef CA1
#define CA1

#include "LinkedList.h"
#include <fstream>
#include <string>
#include <sstream>
#include <iostream>
#include <math.h>
#include <time.h>
#include "bn_prime.h"

using std::string;
using std::ofstream;
using std::ifstream;



#define n 106261

void run();
int m_exp(int, int, int);
long long ml_exp(long long, int, long long);
void computeResults(int, const int*, const int*, int*, int*, int*, int*, int*, int*);
void writeResults(int, int*, int *, int*);
void setArrays(int*,bool*, int*, bool*);
bool isPrimRoot(int);
bool isRelPrime(int);
void writeTotalResults(const int*, const int*, const int*,
		       const int*, const int*, const int*,
		       const int*, const int*, const int*,
		       const int*, const int*, const int*,
		       const int*, const int*, const int*,
		       const int*, const int*, const int*, const int*, const int*,
		       const int*, const int*, const int*, const int*, const int*,
		       const int*, const int*, const int*, const int*, const int*);
int gcd(int, int);
bool isPrime(int);
bool MillerRabin(int, int, int, int);


template<class F1, class F2> void convert(F1 in, F2 out){
	std::stringstream ss;
	ss << in;
	ss>> out;
}

#endif