Language: C++

#include <bits/stdc++.h>
#include <iomanip>
//#define DEBUG 1

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PLDLD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<char> VB;

#define FOR(i,a,b) for(int i=(a);i<(int)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define ALL(a) a.begin(),a.end()
#define UNQ(a) a.erase(std::unique(ALL(a)),a.end());
#define endl "\n"

const LD EPS=1e-5;
const long long INFLL=(LL)(1e9)*(LL)(1e9);
const int INF=1e9+7;

template<class T>
void chmin(T& a, const T b)
{
	if(a>b)
		a=b;
}
template<class T>
void chmax(T& a, const T b)
{
	if(a<b)
		a=b;
}

const LL powLL(const LL p, const LL q)
{
	LL t=1;
	for(int i=0;i<q;i++)
		t*=p;
	return t;
}

template <typename T>
struct has_iter
{
	private:
		template <typename U>
		static constexpr true_type check(typename U::iterator*);
		template <typename U>
		static constexpr false_type check(...);

	public:
		static constexpr bool value = decltype(check<T>(nullptr))::value;
};


template<typename T, typename U = typename T::iterator>
void print(const T& container)
{
		auto&& first=begin(container), last=end(container);
		auto&& back=prev(last);
		for(auto e=first; e!=last; e=next(e))
			cout<<*e<<" \n"[e==back];
}


extern void* enabler;
template<typename Head, typename enable_if<!has_iter<Head>::value>::type*& = enabler>
void print(const Head& head)
{
	cout<<head<<endl;
}

template<> void print<string>(const string& container)
{
	cout<<container<<endl;
}

template<typename Head, typename... Tail>
void print(const Head& head, const Tail&... tail)
{
	cout<<head<<" ";
	print(tail...);
}

template<typename... Args>
void printd(const Args&... args)
{
	#ifdef DEBUG
		print(args...);
	#endif
}

template<typename Head>
void input(Head& head)
{
	cin>>head;
}

template<typename Head, typename... Tail>
void input(Head& head, Tail&... tail)
{
	cin>>head;
	input(tail...);
}

void io_speedup()
{
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
}

template<typename T>
istream& operator >> (istream& is, vector<T>& vec)
{
	for(T& x: vec) is >> x;
	return is;
}


template<typename T, typename U>
istream& operator >> (istream& is, pair<T, U>& t)
{
	is>>t.first>>t.second;
	return is;
}

template<int N, typename... Ts, typename enable_if<N == sizeof...(Ts)-1>::type*& = enabler>
void tuple_in(istream &is, tuple<Ts...> &t)
{
	is>>get<N>(t);
}
template<int N, typename... Ts, typename enable_if<N < sizeof...(Ts)-1>::type*& = enabler>
void tuple_in(istream &is, tuple<Ts...> &t)
{
	is>>get<N>(t);
	tuple_in<N+1, Ts...>(is, t);
}

template<typename... Ts>
istream& operator >> (istream& is, tuple<Ts...>& t)
{
	tuple_in<0, Ts...>(is, t);
	return is;
}


template<typename T, typename U>
ostream& operator << (ostream& os, const pair<T, U>& t)
{
	os<<'('<<t.first<<", "<<t.second<<')';
	return os;
}

template<int N, typename... Ts, typename enable_if<N == sizeof...(Ts)-1>::type*& = enabler>
void tuple_out(ostream &os,const tuple<Ts...> &t)
{
	os<<get<N>(t);
}
template<int N, typename... Ts, typename enable_if<N < sizeof...(Ts)-1>::type*& = enabler>
void tuple_out(ostream &os,const tuple<Ts...> &t)
{
	os<<get<N>(t)<<", ";
	tuple_out<N+1, Ts...>(os, t);
}

template<typename... Ts>
ostream& operator << (ostream& os, const tuple<Ts...>& t)
{
	os<<'(';
	tuple_out<0, Ts...>(os, t);
	os<<')';
	return os;
}

template<typename T>
vector<T> read(int n)
{
	vector<T> t(n);
	cin>>t;
	return t;
}

template<typename T>
T read()
{
	T t;
	cin>>t;
	return t;
}

template<typename Head, typename... Tail>
struct vector_demensions
{
	using type=vector<typename vector_demensions<Tail...>::type>;
};

template<typename Head>
struct vector_demensions<Head> { using type=Head; };

template<typename T>
vector<T> make_vectors(int size, T val)
{
	return vector<T>(size, val);
}

template<typename T=int, typename... Args>
auto make_vectors(int size, Args... tail)
	-> typename vector_demensions<Args..., T>::type
{
	auto val=make_vectors<T>(forward<Args>(tail)...);
	return vector<decltype(val)>(size, val);

}

//c++14

class Mod
{
	public:
		using value_type = long long;

	private:
		static const value_type MODULO = 1e9+7;
		value_type value;

		constexpr value_type Normalize(value_type x) const
		{
			return x<0?(x%MODULO+MODULO):(x%MODULO);
		}

	public:
		constexpr Mod():value(0){}
		constexpr Mod(const value_type &val):value(Normalize(val)) {}
		
		constexpr explicit operator value_type () const
		{
			return value;
		}

		constexpr const Mod operator -() const
		{
			return Mod(MODULO - value);
		}
		constexpr const Mod operator +(const Mod &rhs) const
		{
			return Mod(value + rhs.value);
		}
		constexpr const Mod operator -(const Mod &rhs) const
		{
			return Mod(value + (-rhs).value);
		}
		constexpr const Mod operator *(const Mod &rhs) const
		{
			return Mod(value * rhs.value);
		}
		constexpr Mod &operator +=(const Mod &rhs)
		{
			value = Normalize(value + rhs.value);
			return *this;
		}
		constexpr Mod &operator -=(const Mod &rhs)
		{
			value = Normalize(value - rhs.value);
			return *this;
		}
		constexpr Mod &operator *=(const Mod &rhs)
		{
			value = Normalize(value * rhs.value);
			return *this;
		}


		constexpr Mod pow(value_type p) const;

		constexpr Mod inv() const
		{
			return pow(MODULO-2);
		}

		constexpr const Mod operator /(const Mod &rhs) const
		{
			return *this * rhs.inv();
		}
		constexpr Mod &operator /=(const Mod &rhs)
		{
			return *this = *this / rhs;
		}  
		constexpr bool operator ==(const Mod &rhs)
		{
			return value == rhs.value;
		}
};

constexpr Mod Mod::pow(value_type p) const
{
	Mod tmp=1, mult=*this;
	while(p)
	{
		if((p&1)>0) tmp*=mult;
		p>>=1;
		mult*=mult;
	}
	return tmp;
}

namespace std
{
	ostream& operator<<(ostream& os, const Mod mod)
	{
		os<<(typename Mod::value_type)mod;
		return os;
	}
};



template<size_t N>
struct Factorial
{
	private:
		Mod ary[N];
	public:
		constexpr explicit Factorial():ary()
		{
			ary[0]=1;
			for(size_t i=1;i<N;i++)
				ary[i]=ary[i-1]*i;
		}

		constexpr size_t size() const {   return N;  }

		constexpr Mod operator[] (const int id) const
		{
			return ary[id];
		}
};

template<size_t N>
class FactorialInv
{
	private:
		Mod ary[N];
	public:
		constexpr explicit FactorialInv(const Factorial<N> &fact):ary()
		{
			for(size_t i=0;i<N;i++)
				ary[i]=fact[i].inv();
		}

		//FactorialInv& operator=(FactorialInv&&)=default;

		constexpr Mod operator[] (const int id) const
		{
			return ary[id];
		}
};

template<size_t N, size_t M = N>
class Combination
{
	private:
		const Factorial<N> fact;
		const FactorialInv<M> fact_inv;
	public:
		constexpr Combination(const Factorial<N> fact_, const FactorialInv<M> fact_inv_)
		:fact(fact_),fact_inv(fact_inv_)
		{}

		constexpr Mod operator()(const int n, const int m) const
		{
			return (fact)[n] * (fact_inv)[m] * (fact_inv)[n-m];
		}
};

int main()
{
	Factorial<1024> fact;
	int n,x;
	cin>>n>>x;
	auto s(read<int>(n));
	sort(ALL(s), greater<int>());
	using MIM=map<int,Mod>;
	using VMIM = vector<MIM>;
	VMIM dp(n);
	dp[0][x]=1;
	REP(i,n)
	{
		VMIM dp2(n);
		REP(j,n-1)
			dp2[j+1]=dp[j];
		REP(j,n)
		for(auto&& e:dp[j])
		{
			int k;Mod val;
			tie(k,val)=e;
			REP(l,j+1)
				dp2[l][k%s[i]]+=dp[j][k]*fact[j]/fact[l];
		}
		dp=move(dp2);
	}
	Mod ans=0;
	Mod ver=0;
	int j=0;
	for(auto&& e:dp[j])
	{
		int k;Mod val;
		tie(k,val)=e;
		printd(val, j, k);
		ans+=val*fact[j]*Mod(k);
		ver+=val*fact[j];
	}
	printd(ver);
	print(ans);
}#include <bits/stdc++.h>
#include <iomanip>
//#define DEBUG 1

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
typedef pair<LD, LD> PLDLD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<char> VB;

#define FOR(i,a,b) for(int i=(a);i<(int)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define CLR(a) memset((a), 0 ,sizeof(a))
#define ALL(a) a.begin(),a.end()
#define UNQ(a) a.erase(std::unique(ALL(a)),a.end());
#define endl "\n"

const LD EPS=1e-5;
const long long INFLL=(LL)(1e9)*(LL)(1e9);
const int INF=1e9+7;

template<class T>
void chmin(T& a, const T b)
{
	if(a>b)
		a=b;
}
template<class T>
void chmax(T& a, const T b)
{
	if(a<b)
		a=b;
}

const LL powLL(const LL p, const LL q)
{
	LL t=1;
	for(int i=0;i<q;i++)
		t*=p;
	return t;
}

template <typename T>
struct has_iter
{
	private:
		template <typename U>
		static constexpr true_type check(typename U::iterator*);
		template <typename U>
		static constexpr false_type check(...);

	public:
		static constexpr bool value = decltype(check<T>(nullptr))::value;
};


template<typename T, typename U = typename T::iterator>
void print(const T& container)
{
		auto&& first=begin(container), last=end(container);
		auto&& back=prev(last);
		for(auto e=first; e!=last; e=next(e))
			cout<<*e<<" \n"[e==back];
}


extern void* enabler;
template<typename Head, typename enable_if<!has_iter<Head>::value>::type*& = enabler>
void print(const Head& head)
{
	cout<<head<<endl;
}

template<> void print<string>(const string& container)
{
	cout<<container<<endl;
}

template<typename Head, typename... Tail>
void print(const Head& head, const Tail&... tail)
{
	cout<<head<<" ";
	print(tail...);
}

template<typename... Args>
void printd(const Args&... args)
{
	#ifdef DEBUG
		print(args...);
	#endif
}

template<typename Head>
void input(Head& head)
{
	cin>>head;
}

template<typename Head, typename... Tail>
void input(Head& head, Tail&... tail)
{
	cin>>head;
	input(tail...);
}

void io_speedup()
{
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
}

template<typename T>
istream& operator >> (istream& is, vector<T>& vec)
{
	for(T& x: vec) is >> x;
	return is;
}


template<typename T, typename U>
istream& operator >> (istream& is, pair<T, U>& t)
{
	is>>t.first>>t.second;
	return is;
}

template<int N, typename... Ts, typename enable_if<N == sizeof...(Ts)-1>::type*& = enabler>
void tuple_in(istream &is, tuple<Ts...> &t)
{
	is>>get<N>(t);
}
template<int N, typename... Ts, typename enable_if<N < sizeof...(Ts)-1>::type*& = enabler>
void tuple_in(istream &is, tuple<Ts...> &t)
{
	is>>get<N>(t);
	tuple_in<N+1, Ts...>(is, t);
}

template<typename... Ts>
istream& operator >> (istream& is, tuple<Ts...>& t)
{
	tuple_in<0, Ts...>(is, t);
	return is;
}


template<typename T, typename U>
ostream& operator << (ostream& os, const pair<T, U>& t)
{
	os<<'('<<t.first<<", "<<t.second<<')';
	return os;
}

template<int N, typename... Ts, typename enable_if<N == sizeof...(Ts)-1>::type*& = enabler>
void tuple_out(ostream &os,const tuple<Ts...> &t)
{
	os<<get<N>(t);
}
template<int N, typename... Ts, typename enable_if<N < sizeof...(Ts)-1>::type*& = enabler>
void tuple_out(ostream &os,const tuple<Ts...> &t)
{
	os<<get<N>(t)<<", ";
	tuple_out<N+1, Ts...>(os, t);
}

template<typename... Ts>
ostream& operator << (ostream& os, const tuple<Ts...>& t)
{
	os<<'(';
	tuple_out<0, Ts...>(os, t);
	os<<')';
	return os;
}

template<typename T>
vector<T> read(int n)
{
	vector<T> t(n);
	cin>>t;
	return t;
}

template<typename T>
T read()
{
	T t;
	cin>>t;
	return t;
}

template<typename Head, typename... Tail>
struct vector_demensions
{
	using type=vector<typename vector_demensions<Tail...>::type>;
};

template<typename Head>
struct vector_demensions<Head> { using type=Head; };

template<typename T>
vector<T> make_vectors(int size, T val)
{
	return vector<T>(size, val);
}

template<typename T=int, typename... Args>
auto make_vectors(int size, Args... tail)
	-> typename vector_demensions<Args..., T>::type
{
	auto val=make_vectors<T>(forward<Args>(tail)...);
	return vector<decltype(val)>(size, val);

}

//c++14

class Mod
{
	public:
		using value_type = long long;

	private:
		static const value_type MODULO = 1e9+7;
		value_type value;

		constexpr value_type Normalize(value_type x) const
		{
			return x<0?(x%MODULO+MODULO):(x%MODULO);
		}

	public:
		constexpr Mod():value(0){}
		constexpr Mod(const value_type &val):value(Normalize(val)) {}
		
		constexpr explicit operator value_type () const
		{
			return value;
		}

		constexpr const Mod operator -() const
		{
			return Mod(MODULO - value);
		}
		constexpr const Mod operator +(const Mod &rhs) const
		{
			return Mod(value + rhs.value);
		}
		constexpr const Mod operator -(const Mod &rhs) const
		{
			return Mod(value + (-rhs).value);
		}
		constexpr const Mod operator *(const Mod &rhs) const
		{
			return Mod(value * rhs.value);
		}
		constexpr Mod &operator +=(const Mod &rhs)
		{
			value = Normalize(value + rhs.value);
			return *this;
		}
		constexpr Mod &operator -=(const Mod &rhs)
		{
			value = Normalize(value - rhs.value);
			return *this;
		}
		constexpr Mod &operator *=(const Mod &rhs)
		{
			value = Normalize(value * rhs.value);
			return *this;
		}


		constexpr Mod pow(value_type p) const;

		constexpr Mod inv() const
		{
			return pow(MODULO-2);
		}

		constexpr const Mod operator /(const Mod &rhs) const
		{
			return *this * rhs.inv();
		}
		constexpr Mod &operator /=(const Mod &rhs)
		{
			return *this = *this / rhs;
		}  
		constexpr bool operator ==(const Mod &rhs)
		{
			return value == rhs.value;
		}
};

constexpr Mod Mod::pow(value_type p) const
{
	Mod tmp=1, mult=*this;
	while(p)
	{
		if((p&1)>0) tmp*=mult;
		p>>=1;
		mult*=mult;
	}
	return tmp;
}

namespace std
{
	ostream& operator<<(ostream& os, const Mod mod)
	{
		os<<(typename Mod::value_type)mod;
		return os;
	}
};



template<size_t N>
struct Factorial
{
	private:
		Mod ary[N];
	public:
		constexpr explicit Factorial():ary()
		{
			ary[0]=1;
			for(size_t i=1;i<N;i++)
				ary[i]=ary[i-1]*i;
		}

		constexpr size_t size() const {   return N;  }

		constexpr Mod operator[] (const int id) const
		{
			return ary[id];
		}
};

template<size_t N>
class FactorialInv
{
	private:
		Mod ary[N];
	public:
		constexpr explicit FactorialInv(const Factorial<N> &fact):ary()
		{
			for(size_t i=0;i<N;i++)
				ary[i]=fact[i].inv();
		}

		//FactorialInv& operator=(FactorialInv&&)=default;

		constexpr Mod operator[] (const int id) const
		{
			return ary[id];
		}
};

template<size_t N, size_t M = N>
class Combination
{
	private:
		const Factorial<N> fact;
		const FactorialInv<M> fact_inv;
	public:
		constexpr Combination(const Factorial<N> fact_, const FactorialInv<M> fact_inv_)
		:fact(fact_),fact_inv(fact_inv_)
		{}

		constexpr Mod operator()(const int n, const int m) const
		{
			return (fact)[n] * (fact_inv)[m] * (fact_inv)[n-m];
		}
};

int main()
{
	Factorial<1024> fact;
	int n,x;
	cin>>n>>x;
	auto s(read<int>(n));
	sort(ALL(s), greater<int>());
	using MIM=map<int,Mod>;
	using VMIM = vector<MIM>;
	VMIM dp(n);
	dp[0][x]=1;
	REP(i,n)
	{
		VMIM dp2(n);
		REP(j,n-1)
			dp2[j+1]=dp[j];
		REP(j,n)
		for(auto&& e:dp[j])
		{
			int k;Mod val;
			tie(k,val)=e;
			REP(l,j+1)
				dp2[l][k%s[i]]+=dp[j][k]*fact[j]/fact[l];
		}
		dp=move(dp2);
	}
	Mod ans=0;
	Mod ver=0;
	int j=0;
	for(auto&& e:dp[j])
	{
		int k;Mod val;
		tie(k,val)=e;
		printd(val, j, k);
		ans+=val*fact[j]*Mod(k);
		ver+=val*fact[j];
	}
	printd(ver);
	print(ans);
}

Compiler output:
a.cc:421:2: error: stray '#' in program
  421 | }#include <bits/stdc++.h>
      |  ^
a.cc:421:3: error: 'include' does not name a type
  421 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:443:10: error: redefinition of 'const LD EPS'
  443 | const LD EPS=1e-5;
      |          ^~~
a.cc:23:10: note: 'const LD EPS' previously defined here
   23 | const LD EPS=1e-5;
      |          ^~~
a.cc:444:17: error: redefinition of 'const long long int INFLL'
  444 | const long long INFLL=(LL)(1e9)*(LL)(1e9);
      |                 ^~~~~
a.cc:24:17: note: 'const long long int INFLL' previously defined here
   24 | const long long INFLL=(LL)(1e9)*(LL)(1e9);
      |                 ^~~~~
a.cc:445:11: error: redefinition of 'const int INF'
  445 | const int INF=1e9+7;
      |           ^~~
a.cc:25:11: note: 'const int INF' previously defined here
   25 | const int INF=1e9+7;
      |           ^~~
a.cc:448:6: error: redefinition of 'template<class T> void chmin(T&, T)'
  448 | void chmin(T& a, const T b)
      |      ^~~~~
a.cc:28:6: note: 'template<class T> void chmin(T&, T)' previously declared here
   28 | void chmin(T& a, const T b)
      |      ^~~~~
a.cc:454:6: error: redefinition of 'template<class T> void chmax(T&, T)'
  454 | void chmax(T& a, const T b)
      |      ^~~~~
a.cc:34:6: note: 'template<class T> void chmax(T&, T)' previously declared here
   34 | void chmax(T& a, const T b)
      |      ^~~~~
a.cc:460:10: error: redefinition of 'const LL powLL(LL, LL)'
  460 | const LL powLL(const LL p, const LL q)
      |          ^~~~~
a.cc:40:10: note: 'const LL powLL(LL, LL)' previously defined here
   40 | const LL powLL(const LL p, const LL q)
      |          ^~~~~
a.cc:469:8: error: redefinition of 'struct has_iter<T>'
  469 | struct has_iter
      |        ^~~~~~~~
a.cc:49:8: note: previous definition of 'struct has_iter<T>'
   49 | struct has_iter
      |        ^~~~~~~~
a.cc:483:6: error: redefinition of 'template<class T, class U> void print(const T&)'
  483 | void print(const T& container)
      |      ^~~~~
a.cc:63:6: note: 'template<class T, class U> void print(const T&)' previously declared here
   63 | void print(const T& container)
      |      ^~~~~
a.cc:494:6: error: redefinition of 'template<class Head, typename std::enable_if<(! has_iter<T>::value)>::type*& <anonymous> > void print(const Head&)'
  494 | void print(const Head& head)
      |      ^~~~~
a.cc:74:6: note: 'template<class Head, typename std::enable_if<(! has_iter<T>::value)>::type*& <anonymous> > void print(const Head&)' previously declared here
   74 | void print(const Head& head)
      |      ^~~~~
a.cc:499:17: error: redefinition of 'void print(const T&) [with T = std::__cxx11::basic_string<char>; U = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >]'
  499 | template<> void print<string>(const string& container)
      |                 ^~~~~~~~~~~~~
a.cc:79:17: note: 'void print(const T&) [with T = std::__cxx11::basic_string<char>; U = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >]' previously declared here
   79 | template<> void print<string>(const string& container)
      |                 ^~~~~~~~~~~~~
a.cc:505:6: error: redefinition of 'template<class Head, class ... Tail> void print(const Head&, const Tail& ...)'
  505 | void print(const Head& head, const Tail&... tail)
      |      ^~~~~
a.cc:85:6: note: 'template<class Head, class ... Tail> void print(const Head&, const Tail& ...)' previously declared here
   85 | void print(const Head& head, const Tail&... tail)
      |      ^~~~~
a.cc:512:6: error: redefinition of 'template<class ... Args> void printd(const Args& ...)'
  512 | void printd(const Args&... args)
      |      ^~~~~~
a.cc:92:6: note: 'template<class ... Args> void printd(const Args& ...)' previously declared here
   92 | void printd(const Args&... args)
      |      ^~~~~~
a.cc:520:6: error: redefinition of 'template<class Head> void input(Head&)'
  520 | void input(Head& head)
      |      ^~~~~
a.cc:100:6: note: 'template<class Head> void input(Head&)' previously declared here
  100 | void input(Head& head)
      |      ^~~~~
a.cc:526:6: error: redefinition of 'template<class Head, class ... Tail> void input(Head&, Tail& ...)'
  526 | void input(Head& head, Tail&... tail)
      |      ^~~~~
a.cc:106:6: note: 'template<class Head, class ... Tail> void input(Head&, Tail& ...)' previously declared here
  106 | void input(Head& head, Tail&... tail)
      |      ^~~~~
a.cc:532:6: error: redefinition of 'void io_speedup()'
  532 | void io_speedup()
      |      ^~~~~~~~~~
a.cc:112:6: note: 'void io_speedup()' previously defined here
  112 | void io_speedup()
      |      ^~~~~~~~~~
a.cc:540:10: error: redefinition of 'template<class T> std::istream& operator>>(std::istream&, std::vector<_Tp>&)'
  540 | istream& operator >> (istream& is, vector<T>& vec)
      |          ^~~~~~~~
a.cc:120:10: note: 'template<class T> std::istream& operator>>(std::istream&, std::vector<_Tp>&)' previously declared here
  120 | istream& operator >> (istream& is, vector<T>& vec)
      |          ^~~~~~~~
a.cc:548:10: error: redefinition of 'template<class T, class U> std::istream& operator>>(std::istream&, std::pair<_T1, _T2>&)'
  548 | istream& operator >> (istream& is, pair<T, U>& t)
      |          ^~~~~~~~
a.cc:128:10: note: 'template<class T, class U> std::istream& operator>>(std::istream&, std::pair<_T1, _T2>&)' previously declared here
  128 | istream& operator >> (istream& is, pair<T, U>& t)
      |          ^~~~~~~~
a.cc:555:6: error: redefinition of 'template<int N, class ... Ts, typename std::enable_if<(N == (sizeof... (Ts) - 1))>::type*& <anonymous> > void tuple_in(std::istream&, std::tuple<_Elements ...>&)'
  555 | void tuple_in(istream &is, tuple<Ts...> &t)
      |      ^~~~~~~~
a.cc:135:6: note: 'template<int N, class ... Ts, typename std::enable_if<(N == (sizeof... (Ts) - 1))>::type*& <anonymous> > void tuple_in(std::istream&, std::tuple<_Elements ...>&)' previously declared here
  135 | void tuple_in(istream &is, tuple<Ts...> &t)
      |      ^~~~~~~~
a.cc:560:6: error: redefinition of 'template<int N, class ... Ts, typename std::enable_if<(N < (sizeof... (Ts) - 1))>::type*& <anonymous> > void tuple_in(std::istream&, std::tuple<_Elements ...>&)'
  560 | void tuple_in(istream &is, tuple<Ts...> &t)
      |      ^~~~~~~~
a.cc:140:6: note: 'template<int N, class ... Ts, typename std::enable_if<(N < (sizeof... (Ts) - 1))>::type*& <anonymous> > void tuple_in(std::istream&, std::tuple<_Elements ...>&)' previously declared here
  140 | void tuple_in(istream &is, tuple<Ts...> &t)
      |      ^~~~~~~~
a.cc:567:10: error: redefinition of 'template<class ... Ts> std::istream& operator>>(std::istream&, std::tuple<_UTypes ...>&)'
  567 | istream& operator >> (istream& is, tuple<Ts...>& t)
      |          ^~~~~~~~
a.cc:147:10: note: 'template<class ... Ts> std::istream& operator>>(std::istream&, std::tuple<_UTypes ...>&)' previously declared here
  147 | istream& operator >> (istream& is, tuple<Ts...>& t)
      |          ^~~~~~~~
a.cc:575:10: error: redefinition of 'template<class T, class U> std::ostream& operator<<(std::ostream&, const std::pair<_T1, _T2>&)'
  575 | ostream& operator << (ostream& os, const pair<T, U>& t)
      |          ^~~~~~~~
a.cc:155:10: note: 'template<class T, class U> std::ostream& operator<<(std::ostream&, const std::pair<_T1, _T2>&)' previously declared here
  155 | ostream& operator << (ostream& os, const pair<T, U>& t)
      |          ^~~~~~~~
a.cc:582:6: error: redefinition of 'template<int N, class ... Ts, typename std::enable_if<(N == (sizeof... (Ts) - 1))>::type*& <anonymous> > void tuple_out(std::ostream&, const std::tuple<_Elements ...>&)'
  582 | void tuple_out(ostream &os,const tuple<Ts...> &t)
      |      ^~~~~~~~~
a.cc:162:6: note: 'template<int N, class ... Ts, typename std::enable_if<(N == (sizeof... (Ts) - 1))>::type*& <anonymous> > void tuple_out(std::ostream&, const std::tuple<_Elements ...>&)' previously declared here
  162 | void tuple_out(ostream &os,const tuple<Ts...> &t)
      |      ^~~~~~~~~
a.cc:587:6: error: redefinition of 'template<int N, class ... Ts, typename std::enable_if<(N < (sizeof... (Ts) - 1))>::type*& <anonymous> > void tuple_out(std::ostream&, const std::tuple<_Elements ...>&)'
  587 | void tuple_out(ostream &os,const tuple<Ts...> &t)
      |      ^~~~~~~~~
a.cc:167:6: note: 'template<int N, class ... Ts, typename std::enable_if<(N < (sizeof... (Ts) - 1))>::type*& <anonymous> > void tuple_out(std::ostream&, const std::tuple<_Elements ...>&)' previously declared here
  167 | void tuple_out(ostream &os,const tuple<Ts...> &t)
      |      ^~~~~~~~~
a.cc:594:10: error: redefinition of 'template<class ... Ts> std::ostream& operator<<(std::ostream&, const std::tuple<_UTypes ...>&)'
  594 | ostream& operator << (ostream& os, const tuple<Ts...>& t)
      |          ^~~~~~~~
a.cc:174:10: note: 'template<class ... Ts> std::ostream& operator<<(std::ostream&, const std::tuple<_UTypes ...>&)' previously declared here
  174 | ostream& operator << (ostream& os, const tuple<Ts...>& t)
      |          ^~~~~~~~
a.cc:603:11: error: redefinition of 'template<class T> std::vector<_Tp> read(int)'
  603 | vector<T> read(int n)
      |           ^~~~
a.cc:183:11: note: 'template<class T> std::vector<_Tp> read(int)' previously declared here
  183 | vector<T> read(int n)
      |           ^~~~
a.cc:611:3: error: redefinition of 'template<class T> T read()'
  611 | T read()
      |   ^~~~
a.cc:191:3: note: 'template<class T> T read()' previously declared here
  191 | T read()
      |   ^~~~
a.cc:619:8: error: redefinition of 'struct vector_demensions<Head, Tail>'
  619 | struct vector_demensions
      |        ^~~~~~~~~~~~~~~~~
a.cc:199:8: note: previous definition of 'struct vector_demensions<Head, Tail>'
  199 | struct vector_demensions
      |        ^~~~~~~~~~~~~~~~~
a.cc:625:8: error: redefinition of 'struct vector_demensions<Head>'
  625 | struct vector_demensions<Head> { using type=Head; };
      |        ^~~~~~~~~~~~~~~~~~~~~~~
a.cc:205:8: note: previous definition of 'struct vector_demensions<Head>'
  205 | struct vector_demensions<Head> { using type=Head; };
      |