Language: C++

#include <bits/stdc++.h>
//#include <mylib.h>
using namespace std;
//cin.sync_with_stdio(false);

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define FOR_EQ(i,a,b) for(int i = (a); i <= (b); ++i)
#define FOR_RE(i,a,b) for(int i = (a); i >= (b); --i)   // 終端を0じゃなくて、1まですることによってn回。感覚的に1以上にしておいた。
#define rep(i,n) FOR(i,0,n)
#define rep_eq(i,n) FOR_EQ(i,0,n)
#define rep_re(i,n) FOR_RE(i,n,1)

#define #include <bits/stdc++.h>
//#include <mylib.h>
using namespace std;
//cin.sync_with_stdio(false);

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define FOR_EQ(i,a,b) for(int i = (a); i <= (b); ++i)
#define FOR_RE(i,a,b) for(int i = (a); i >= (b); --i)   // 終端を0じゃなくて、1まですることによってn回。感覚的に1以上にしておいた。
#define rep(i,n) FOR(i,0,n)
#define rep_eq(i,n) FOR_EQ(i,0,n)
#define rep_re(i,n) FOR_RE(i,n,1)

#define DEBUG_VARIABLE(variable) cout << #variable << ":" << variable << endl

#define WHITE 1//（未訪問）
#define GRAY 2//（訪問）未だに訪問していない頂点への辺を持っている。スタックに退避。
#define BLACK 3//（訪問完了）未訪問への頂点への辺を持たない
//#define N 100
#define INFTY (1 << 21) //10^21
#define INF (1 << 9)
//int M[N][N];// 隣接行列(頂点と頂点が繋がってる、もしくは重みの値)
//int color[N]; // その頂点の探索具合
const int TABLEMAX = 510000;
const int MOD = 1000000007;
//二項係数用の各階乗の値とその逆元を記録するための配列．
long long fac[TABLEMAX], finv[TABLEMAX], inv[TABLEMAX];

//1個上から時計周り
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
//上右下左
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
static const int NIL = -1;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> Vector;
typedef vector<Vector> DVector;
typedef vector<pair<ll, ll>> Vec_map;
//因数分解で使う。firstは数。secondは指数。
vector<pair<ll, ll>> prime_factor;
//因数の一覧を取得で使う
Vector factor_list;

ll n;

template <class X> void printArray(X *array, ll);
template <class X> void printVector(vector<X> &v);
template <class X> void printDimention(vector<vector<X>> &dv);
template <class X> void printMap(X);
template <class X> void printVecPair(vector<X> &v);
// 何個2がかかっているか
int factor2(int);
//nCr方式で組み合わせの数を求める
ll combination(int, int);
//nPrで階乗を求める
int factorial(int, int);
//桁数を返す
int find_digits(int);
// 各桁の和を計算する関数
int findSumOfDigits(int);
//次数を得る
int degree(int);
//四捨五入
int shishagonyu(double);
//切り上げ
int roundUp(double);
//切り捨て
int roundDown(double);
//四捨五入
int roundOff(double);
//最大公約数(Greatest Common Divisor)
int gcd (int, int);
//最小公倍数(Least Common Multiple)
ll lcm(ll, ll);
//素因数分解
void prime_factorization(ll);
//エラトステネスの篩
int Eratosthenes(int);
//偶奇判定。奇数ならtrue。
bool odd_even(int);
//aのmod mにおける逆元を計算する
long long modinv(long long, long long);
// a^n mod を計算する（二分累乗）
long long modpow(long long, long long, long long);
//テーブルを作る前処理
void COMinit();
//二項係数計算 nCk, 1 <= k <= n <= 10^7
long long COM(int, int);
// longlong型で絶対値を帰す。
long long abs_ll(ll);
// 割り算した時に余りが有る時だけ、+1の商を返す。
long long div_one(ll, ll);
// Stringの各桁をvectorの配列に入れる。でかい桁が添字0。
template <class X> void StringtoVec(string, vector<X> &v);
// 因数の一覧を取得する
void get_factor_list(ll);

void warshall_floyd(DVector &d, ll n){
    rep(i, n){  //経由する頂点
        rep(j, n){  //開始頂点
            rep(k, n){  //終点
                if(d[j][i] < INFTY && cost[i][k] < INFTY){
                    d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
                }
            }
        }
    }
    //printDimention(d);
}

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N, M, R;
    cin >> N >> M >> R;
    ll r[R];
    rep(i, R)   cin >> r[i];

    DVector travel(N, vector<ll>(N, INFTY));
    rep(i, N)   travel[i][i] = 0;
    rep(i, M){
        ll a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        travel[a][b] = travel[b][a] = c;
    }

    warshall_floyd(travel, N);

    //cout  << endl;
    //printDimention(travel);
    ll cnt = INFTY;
    ll tmp = 0;
    sort(r, r + R);
    do{
        tmp  = 0;
        /*
        rep(i, R) {
            cout << r[i];
            if(i == R - 1) cout << endl;
            else cout << ' ';
        }
        */
        

        rep(i, R - 1){
            ll from, to;
            from = r[i] - 1;
            to = r[i + 1] - 1;
            tmp += travel[from][to];
        }
        cnt = min(cnt, tmp);
    }while(next_permutation(r, r + R));
    
    cout << cnt << endl;


    return 0;
}

template<class X> void printArray(X array[], ll n){
    rep(i, n){
        if(i)   cout << " ";
        cout << array[i];
    }
    cout << endl;
}

template<class X> void printVector(vector<X> &v){
    rep(i, (int)v.size()){
        if(i)   cout << " ";
        cout << v[i];
    }
    cout << endl;
}

//二次元配列の表示
template<class X> void printDimention(vector<vector<X>> &dv){
    rep(i, (ll)dv.size()){
        rep(j, (ll)dv[i].size()){
            if(j)   cout << " ";
            cout << dv[i][j];
        }
        cout << endl;
    }
}

//mapの表示
template <class X> void printMap(X mp) {
    for (auto it : mp) {
        cout << it.first << " " << it.second << endl;
    }
}

// 内部にpairを内包したvectorの表示
template <class X> void printVecPair(vector<X> &v){
    rep(i, (int)v.size()){
        cout << v[i].first << " " << v[i].second << endl;
    }
    cout << endl;
}

//numの中に何個2がかかってるか
int factor2(int num){
    int cnt = 0;
    while(num % 2 == 0){
        num /= 2;
        cnt++;
    }
    return cnt;
}

//nCr方式で組み合わせの数を求める
ll combination(int n, int r){
    ll up = 1, down = 1;
    // 以下2行はお試し
    ll half = n / 2;
    if(r >= half)   r = n - r;
    ll up_tmp = n, down_tmp = r;

    if(r == 0)  return 1;
    rep(i, r){
        up *= up_tmp;
        up_tmp--;
        down *= down_tmp;
        down_tmp--;
    }

    return up/down;
}



//nPr方式で階乗を求める
int factorial(int n, int r){
    if(n < r){
        cout << "error" << endl;
        return 0;
    }else{
        int res = 1;
        while(r){
            r--;
            res *= n;
            n--;
        }
        return res;
    }
}

//桁数を返す
int find_digits(int n){
    int digit = 0;

    while(n){
        n /= 10;
        digit++;
    }
    return digit;
}
// 各桁の和を計算する関数
int findSumOfDigits(int n){
    int sum = 0;
    while (n > 0) { // n が 0 になるまで
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
//次数を得る
int degree(int n){
    int count = 0;
    while(1){
        if(count <= 0)  break;
        count /= 2;
        count++;
    }
    return count;
}

//四捨五入
int shishagonyu( double x )
{
    return (int)( x < 0.0 ? x-0.5 : x+0.5 );
}

//切り上げ
int roundUp(double n){
    if(n >= 0){
        return (int)n + 1;
    }else{
        return (int)n - 1;
    }
}

//切り捨て
int roundDown(double n){
    return (int)n;
}

//四捨五入
int roundOff(double n){
    double decimal = 0;

    decimal = n - (int)n;

    if(decimal >= 0.5 || decimal <= -0.5){
        return roundUp(n);
    }else{
        return roundDown(n);
    }
}

//最大公約数(Greatest Common Divisor)
int gcd (int m, int n){
    //引数に0がある場合は0を返す
    if(m == 0 || n == 0)    return 0;
    
    //ユークリッドの互除法
    while(m != n){
        if(m > n)   m = m - n;
        else    n = n - m;
    }
    return m;
}

//最小公倍数(Least Common Multiple)
ll lcm(ll m, ll n){
    //引数に0がある場合は0を返す
    if(m == 0 || n == 0)    return 0;
    
    //lcm = m * n / gcd(m, n)
    return ((m / gcd(m, n)) * n);
}

//素因数分解 firstは数。secondは指数。
void prime_factorization(ll n){
    int a = 2, res;
    
    bool flg = false;
    if(n < 2){
        cout << "Error" << endl;
        return;
    }
    while(n >= a * a){
        if(n % a == 0){
            res = a;
            //resをグローバルな配列に代入すれば記録できる。
            if(flg){
                prime_factor[prime_factor.size() - 1].second++;
            }else{
                prime_factor.push_back(make_pair(0, 1));
                prime_factor[prime_factor.size() - 1].first = res;
            }
            n /= a;
            flg = true;
        }else{
            a++;
            flg = false;
        }
    }
    //ラス1の素因数
    res = n;
    if(prime_factor[prime_factor.size() - 1].first == res){
        prime_factor[prime_factor.size() - 1].second++;
    }else{
        prime_factor.push_back(make_pair(res, 1));
    }
}

//エラトステネスの篩
int Eratosthenes(int n){
    bool prime[n];
    //prime[0]が1、prime[n - 1]がn。
    rep(i, n)   prime[i] = true;
    
    for(int i = 2; i < sqrt(n); i++){
        if(prime[i]){
            for(int j = 0; i * (j + 2) < n; j++){
                prime[i *(j + 2)] = false;
            }
        }
    }

    int cnt = 0;
    for(int i = 2; i < n; i++){
        if(prime[i]){
            cnt++;
        }
    }
    return cnt;
}
//偶奇判定。奇数ならtrue。
bool odd_even(int num){
    bool judge;
    if(num % 2){
        judge = true;
    }else{
        judge = false;
    }
    return judge;
}
//aのmod mにおける逆元を計算する
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//main関数内でCOMinitを呼んだ後，COMを呼ぶ．
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < TABLEMAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算 nCk, nCrのcombinationでも使える
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

long long abs_ll(ll a){
    if(a >= 0){
        return a;
    }else{
        return -a;
    }
}

// 割り算した時に余りが有る時だけ、+1の商を返す。
long long div_one(ll res, ll div){
    // res 割られる数、div 割る数
    return (res + div - 1)/div;
}

// Stringの各桁をvectorの配列に入れる。でかい桁が添字0。
template <class X> void StringtoVec(string str, vector<X> &v){
    ll num = stoll(str);
    ll it = str.size() - 1;
    // 桁を逆にしたい時、下をon
    //ll it = 0;
    v.resize(str.size());
    while(num){
        v[it] = num % 10;
        num /= 10;
        it--;
        //it++;
        if(it < 0){
            cout << "reference error" << endl;
            break;
        }
    }
}

// nに数を入れるとその約数の一覧をfactor_listに格納する
void get_factor_list(ll n){
    int a = 1, res;

    while(n >= a * a){
        if(n % a == 0){
            res = a;
            ll tmp = n / res;
            factor_list.push_back(res);
            factor_list.push_back(tmp);
            a++;
        }else{
            a++;
        }
    }
    sort(factor_list.begin(), factor_list.end());
}(variable) cout << #variable << ":" << variable << endl

#define WHITE 1//（未訪問）
#define GRAY 2//（訪問）未だに訪問していない頂点への辺を持っている。スタックに退避。
#define BLACK 3//（訪問完了）未訪問への頂点への辺を持たない
//#define N 100
#define INFTY (1 << 21) //10^21
#define INF (1 << 9)
//int M[N][N];// 隣接行列(頂点と頂点が繋がってる、もしくは重みの値)
//int color[N]; // その頂点の探索具合
const int TABLEMAX = 510000;
const int MOD = 1000000007;
//二項係数用の各階乗の値とその逆元を記録するための配列．
long long fac[TABLEMAX], finv[TABLEMAX], inv[TABLEMAX];

//1個上から時計周り
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
//上右下左
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
static const int NIL = -1;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> Vector;
typedef vector<Vector> DVector;
typedef vector<pair<ll, ll>> Vec_map;
//因数分解で使う。firstは数。secondは指数。
vector<pair<ll, ll>> prime_factor;
//因数の一覧を取得で使う
Vector factor_list;

ll n;

template <class X> void printArray(X *array, ll);
template <class X> void printVector(vector<X> &v);
template <class X> void printDimention(vector<vector<X>> &dv);
template <class X> void printMap(X);
template <class X> void printVecPair(vector<X> &v);
// 何個2がかかっているか
int factor2(int);
//nCr方式で組み合わせの数を求める
ll combination(int, int);
//nPrで階乗を求める
int factorial(int, int);
//桁数を返す
int find_digits(int);
// 各桁の和を計算する関数
int findSumOfDigits(int);
//次数を得る
int degree(int);
//四捨五入
int shishagonyu(double);
//切り上げ
int roundUp(double);
//切り捨て
int roundDown(double);
//四捨五入
int roundOff(double);
//最大公約数(Greatest Common Divisor)
int gcd (int, int);
//最小公倍数(Least Common Multiple)
ll lcm(ll, ll);
//素因数分解
void prime_factorization(ll);
//エラトステネスの篩
int Eratosthenes(int);
//偶奇判定。奇数ならtrue。
bool odd_even(int);
//aのmod mにおける逆元を計算する
long long modinv(long long, long long);
// a^n mod を計算する（二分累乗）
long long modpow(long long, long long, long long);
//テーブルを作る前処理
void COMinit();
//二項係数計算 nCk, 1 <= k <= n <= 10^7
long long COM(int, int);
// longlong型で絶対値を帰す。
long long abs_ll(ll);
// 割り算した時に余りが有る時だけ、+1の商を返す。
long long div_one(ll, ll);
// Stringの各桁をvectorの配列に入れる。でかい桁が添字0。
template <class X> void StringtoVec(string, vector<X> &v);
// 因数の一覧を取得する
void get_factor_list(ll);

void warshall_floyd(DVector &d, ll n){
    rep(i, n){  //経由する頂点
        rep(j, n){  //開始頂点
            rep(k, n){  //終点
                d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
            }
        }
    }
    //printDimention(d);
}

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N, M, R;
    cin >> N >> M >> R;
    ll r[R];
    rep(i, R)   cin >> r[i];

    DVector travel(N, vector<ll>(N, INFTY));
    rep(i, N)   travel[i][i] = 0;
    rep(i, M){
        ll a, b, c;
        cin >> a >> b >> c;
        a--;
        b--;
        travel[a][b] = travel[b][a] = c;
    }

    warshall_floyd(travel, N);

    //cout  << endl;
    //printDimention(travel);
    ll cnt = INFTY;
    ll tmp = 0;
    sort(r, r + R);
    do{
        tmp  = 0;
        /*
        rep(i, R) {
            cout << r[i];
            if(i == R - 1) cout << endl;
            else cout << ' ';
        }
        */
        

        rep(i, R - 1){
            ll from, to;
            from = r[i] - 1;
            to = r[i + 1] - 1;
            tmp += travel[from][to];
        }
        cnt = min(cnt, tmp);
    }while(next_permutation(r, r + R));
    
    cout << cnt << endl;


    return 0;
}

template<class X> void printArray(X array[], ll n){
    rep(i, n){
        if(i)   cout << " ";
        cout << array[i];
    }
    cout << endl;
}

template<class X> void printVector(vector<X> &v){
    rep(i, (int)v.size()){
        if(i)   cout << " ";
        cout << v[i];
    }
    cout << endl;
}

//二次元配列の表示
template<class X> void printDimention(vector<vector<X>> &dv){
    rep(i, (ll)dv.size()){
        rep(j, (ll)dv[i].size()){
            if(j)   cout << " ";
            cout << dv[i][j];
        }
        cout << endl;
    }
}

//mapの表示
template <class X> void printMap(X mp) {
    for (auto it : mp) {
        cout << it.first << " " << it.second << endl;
    }
}

// 内部にpairを内包したvectorの表示
template <class X> void printVecPair(vector<X> &v){
    rep(i, (int)v.size()){
        cout << v[i].first << " " << v[i].second << endl;
    }
    cout << endl;
}

//numの中に何個2がかかってるか
int factor2(int num){
    int cnt = 0;
    while(num % 2 == 0){
        num /= 2;
        cnt++;
    }
    return cnt;
}

//nCr方式で組み合わせの数を求める
ll combination(int n, int r){
    ll up = 1, down = 1;
    // 以下2行はお試し
    ll half = n / 2;
    if(r >= half)   r = n - r;
    ll up_tmp = n, down_tmp = r;

    if(r == 0)  return 1;
    rep(i, r){
        up *= up_tmp;
        up_tmp--;
        down *= down_tmp;
        down_tmp--;
    }

    return up/down;
}



//nPr方式で階乗を求める
int factorial(int n, int r){
    if(n < r){
        cout << "error" << endl;
        return 0;
    }else{
        int res = 1;
        while(r){
            r--;
            res *= n;
            n--;
        }
        return res;
    }
}

//桁数を返す
int find_digits(int n){
    int digit = 0;

    while(n){
        n /= 10;
        digit++;
    }
    return digit;
}
// 各桁の和を計算する関数
int findSumOfDigits(int n){
    int sum = 0;
    while (n > 0) { // n が 0 になるまで
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
//次数を得る
int degree(int n){
    int count = 0;
    while(1){
        if(count <= 0)  break;
        count /= 2;
        count++;
    }
    return count;
}

//四捨五入
int shishagonyu( double x )
{
    return (int)( x < 0.0 ? x-0.5 : x+0.5 );
}

//切り上げ
int roundUp(double n){
    if(n >= 0){
        return (int)n + 1;
    }else{
        return (int)n - 1;
    }
}

//切り捨て
int roundDown(double n){
    return (int)n;
}

//四捨五入
int roundOff(double n){
    double decimal = 0;

    decimal = n - (int)n;

    if(decimal >= 0.5 || decimal <= -0.5){
        return roundUp(n);
    }else{
        return roundDown(n);
    }
}

//最大公約数(Greatest Common Divisor)
int gcd (int m, int n){
    //引数に0がある場合は0を返す
    if(m == 0 || n == 0)    return 0;
    
    //ユークリッドの互除法
    while(m != n){
        if(m > n)   m = m - n;
        else    n = n - m;
    }
    return m;
}

//最小公倍数(Least Common Multiple)
ll lcm(ll m, ll n){
    //引数に0がある場合は0を返す
    if(m == 0 || n == 0)    return 0;
    
    //lcm = m * n / gcd(m, n)
    return ((m / gcd(m, n)) * n);
}

//素因数分解 firstは数。secondは指数。
void prime_factorization(ll n){
    int a = 2, res;
    
    bool flg = false;
    if(n < 2){
        cout << "Error" << endl;
        return;
    }
    while(n >= a * a){
        if(n % a == 0){
            res = a;
            //resをグローバルな配列に代入すれば記録できる。
            if(flg){
                prime_factor[prime_factor.size() - 1].second++;
            }else{
                prime_factor.push_back(make_pair(0, 1));
                prime_factor[prime_factor.size() - 1].first = res;
            }
            n /= a;
            flg = true;
        }else{
            a++;
            flg = false;
        }
    }
    //ラス1の素因数
    res = n;
    if(prime_factor[prime_factor.size() - 1].first == res){
        prime_factor[prime_factor.size() - 1].second++;
    }else{
        prime_factor.push_back(make_pair(res, 1));
    }
}

//エラトステネスの篩
int Eratosthenes(int n){
    bool prime[n];
    //prime[0]が1、prime[n - 1]がn。
    rep(i, n)   prime[i] = true;
    
    for(int i = 2; i < sqrt(n); i++){
        if(prime[i]){
            for(int j = 0; i * (j + 2) < n; j++){
                prime[i *(j + 2)] = false;
            }
        }
    }

    int cnt = 0;
    for(int i = 2; i < n; i++){
        if(prime[i]){
            cnt++;
        }
    }
    return cnt;
}
//偶奇判定。奇数ならtrue。
bool odd_even(int num){
    bool judge;
    if(num % 2){
        judge = true;
    }else{
        judge = false;
    }
    return judge;
}
//aのmod mにおける逆元を計算する
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//main関数内でCOMinitを呼んだ後，COMを呼ぶ．
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < TABLEMAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算 nCk, nCrのcombinationでも使える
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

long long abs_ll(ll a){
    if(a >= 0){
        return a;
    }else{
        return -a;
    }
}

// 割り算した時に余りが有る時だけ、+1の商を返す。
long long div_one(ll res, ll div){
    // res 割られる数、div 割る数
    return (res + div - 1)/div;
}

// Stringの各桁をvectorの配列に入れる。でかい桁が添字0。
template <class X> void StringtoVec(string str, vector<X> &v){
    ll num = stoll(str);
    ll it = str.size() - 1;
    // 桁を逆にしたい時、下をon
    //ll it = 0;
    v.resize(str.size());
    while(num){
        v[it] = num % 10;
        num /= 10;
        it--;
        //it++;
        if(it < 0){
            cout << "reference error" << endl;
            break;
        }
    }
}

// nに数を入れるとその約数の一覧をfactor_listに格納する
void get_factor_list(ll n){
    int a = 1, res;

    while(n >= a * a){
        if(n % a == 0){
            res = a;
            ll tmp = n / res;
            factor_list.push_back(res);
            factor_list.push_back(tmp);
            a++;
        }else{
            a++;
        }
    }
    sort(factor_list.begin(), factor_list.end());
}

Compiler output:
a.cc:13:9: error: macro names must be identifiers
   13 | #define #include <bits/stdc++.h>
      |         ^
a.cc:509:21: error: stray '#' in program
  509 | }(variable) cout << #variable << ":" << variable << endl
      |                     ^
a.cc: In function 'void warshall_floyd(DVector&, ll)':
a.cc:116:39: error: 'cost' was not declared in this scope; did you mean 'cosl'?
  116 |                 if(d[j][i] < INFTY && cost[i][k] < INFTY){
      |                                       ^~~~
      |                                       cosl
a.cc: At global scope:
a.cc:509:13: error: expected constructor, destructor, or type conversion before 'cout'
  509 | }(variable) cout << #variable << ":" << variable << endl
      |             ^~~~
a.cc:520:11: error: redefinition of 'const int MOD'
  520 | const int MOD = 1000000007;
      |           ^~~
a.cc:36:11: note: 'const int MOD' previously defined here
   36 | const int MOD = 1000000007;
      |           ^~~
a.cc:522:11: error: redefinition of 'long long int fac [510000]'
  522 | long long fac[TABLEMAX], finv[TABLEMAX], inv[TABLEMAX];
      |           ^~~
a.cc:38:11: note: 'long long int fac [510000]' previously declared here
   38 | long long fac[TABLEMAX], finv[TABLEMAX], inv[TABLEMAX];
      |           ^~~
a.cc:522:26: error: redefinition of 'long long int finv [510000]'
  522 | long long fac[TABLEMAX], finv[TABLEMAX], inv[TABLEMAX];
      |                          ^~~~
a.cc:38:26: note: 'long long int finv [510000]' previously declared here
   38 | long long fac[TABLEMAX], finv[TABLEMAX], inv[TABLEMAX];
      |                          ^~~~
a.cc:522:42: error: redefinition of 'long long int inv [510000]'
  522 | long long fac[TABLEMAX], finv[TABLEMAX], inv[TABLEMAX];
      |                                          ^~~
a.cc:38:42: note: 'long long int inv [510000]' previously declared here
   38 | long long fac[TABLEMAX], finv[TABLEMAX], inv[TABLEMAX];
      |                                          ^~~
a.cc:525:11: error: redefinition of 'const int ddx [8]'
  525 | const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
      |           ^~~
a.cc:41:11: note: 'const int ddx [8]' previously defined here
   41 | const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
      |           ^~~
a.cc:526:11: error: redefinition of 'const int ddy [8]'
  526 | const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
      |           ^~~
a.cc:42:11: note: 'const int ddy [8]' previously defined here
   42 | const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
      |           ^~~
a.cc:528:11: error: redefinition of 'const int dx [4]'
  528 | const int dx[4] = {0, 1, 0, -1};
      |           ^~
a.cc:44:11: note: 'const int dx [4]' previously defined here
   44 | const int dx[4] = {0, 1, 0, -1};
      |           ^~
a.cc:529:11: error: redefinition of 'const int dy [4]'
  529 | const int dy[4] = {-1, 0, 1, 0};
      |           ^~
a.cc:45:11: note: 'const int dy [4]' previously defined here
   45 | const int dy[4] = {-1, 0, 1, 0};
      |           ^~
a.cc:530:18: error: redefinition of 'const int NIL'
  530 | static const int NIL = -1;
      |                  ^~~
a.cc:46:18: note: 'const int NIL' previously defined here
   46 | static const int NIL = -1;
      |                  ^~~
a.cc:538:22: error: redefinition of 'std::vector<std::pair<long long int, long long int> > prime_factor'
  538 | vector<pair<ll, ll>> prime_factor;
      |                      ^~~~~~~~~~~~
a.cc:54:22: note: 'std::vector<std::pair<long long int, long long int> > prime_factor' previously declared here
   54 | vector<pair<ll, ll>> prime_factor;
      |                      ^~~~~~~~~~~~
a.cc:540:8: error: redefinition of 'Vector factor_list'
  540 | Vector factor_list;
      |        ^~~~~~~~~~~
a.cc:56:8: note: 'Vector factor_list' previously declared here
   56 | Vector factor_list;
      |        ^~~~~~~~~~~
a.cc:542:4: error: redefinition of 'll n'
  542 | ll n;
      |    ^
a.cc:58:4: note: 'll n' previously declared here
   58 | ll n;
      |    ^
a.cc:596:6: error: redefinition of 'void warshall_floyd(DVector&, ll)'
  596 | void warshall_floyd(DVector &d, ll n){
      |      ^~~~~~~~~~~~~~
a.cc:112:6: note: 'void warshall_floyd(DVector&, ll)' previously defined here
  112 | void warshall_floyd(DVector &d, ll n){
      |      ^~~~~~~~~~~~~~
a.cc:607:5: error: redefinition of 'int main(int, const char**)'
  607 | int main(int argc, char const *argv[])
      |     ^~~~
a.cc:125:5: note: 'int main(int, const char**)' previously defined here
  125 | int main(int argc, char const *argv[])
      |     ^~~~
a.cc:660:24: error: redefinition of 'template<class X> void printArray(X*, ll)'
  660 | template<class X> void printArray(X array[], ll n){
      |                        ^~~~~~~~~~
a.cc:178:24: note: 'template<class X> void printArray(X*, ll)' previously declared here
  178 | template<class X> void printArray(X array[], ll n){
      |                        ^~~~~~~~~~
a.cc:668:24: error: redefinition of 'template<class X> void printVector(std::vector<_Tp>&)'
  668 | template<class X> void printVector(vector<X> &v){
      |                        ^~~~~~~~~~~
a.cc:186:24: note: 'template<class X> void printVector(std::vector<_Tp>&)' previously declared here
  186 | template<class X> void printVector(vector<X> &v){
      |                        ^~~~~~~~~~~
a.cc:677:24: error: redefinition of 'template<class X> void printDimention(std::vector<std::vector<_Tp> >&)'
  677 | template<class X> void printDimention(vector<vector<X>> &dv){
      |                        ^~~~~~~~~~~~~~
a.cc:195:24: note: 'template<class X> void printDimention(std::vector<std::vector<_Tp> >&)' previously declared here
  195 | template<class X> void printDimention(vector<vector<X>> &dv){
      |                        ^~~~~~~~~~~~~~
a.cc:688:25: error: redefinition of 'template<class X> void printMap(X)'
  688 | template <class X> void printMap(X mp) {
      |                         ^~~~~~~~
a.cc:206:25: note: 'template<class X> void printMap(X)' previously declared here
  206 | template <class X> void printMap(X mp) {
      |                         ^~~~~~~~
a.cc:695:25: error: redefinition of 'template<class X> void printVecPair(std::vector<_Tp>&)'
  695 | template <class X> void printVecPair(vector<X> &v){
      |                         ^~~~~~~~~~~~
a.cc:213:25: note: 'template<class X> void printVecPair(std::vector<_Tp>&)' previously declared here
  213 | template <class X> void printVecPair(vector<X> &v){
      |                         ^~~~~~~~~~~~
a.cc:703:5: error: redefinition of 'int factor2(int)'
  703 | int factor2(int num){
      |     ^~~~~~~
a.cc:221:5: note: 'int factor2(int)' previously defined here
  221 | int factor2(int num){
      |     ^~~~~~~
a.cc:713:4: error: redefinition of 'll combination(int, int)'
  713 | ll combination(int n, int r){
      |    ^~~~~~~~~~~
a.cc:231:4: note: 'll combination(int, int)' previously defined here
  231 | ll combination(int n, int r){
      |    ^~~~~~~~~~~
a.cc:734:5: error: redefinition of 'int factorial(int, int)'
  734 | int factorial(int n, int r){
      |     ^~~~~~~~~
a.cc:252:5: note: 'int factorial(int, int)' previously defined here
  252 | int factorial(int n, int r){
      |     ^~~~~~~~~
a.cc:750:5: error: redefinition of 'int find_digits(int)'
  750 | int find_digits(int n){
      |     ^~~~~~~~~~~
a.cc:268:5: note: 'int find_digits(int)' previously defined here
  268 | int find_digits(int n){
      |     ^~~~~~~~~~~
a.cc:760:5: error: redefinition of 'int findSumOfDigits(int)'
  760 | int findSumOfDigits(int n){
      |     ^~~~~~~~~~~~~~~
a.cc:278:5: note: 'int findSumOfDigits(int)' previously defined here
  278 | int findSumOfDigits(int n){
      |     ^~~~~~~~~~~~~~~
a.cc:769:5: error: redefinition of 'int degree(int)'
  769 | int degree(int n){
      |     ^~~~~~
a.cc:287:5: note: 'int degree(int)' previously defined here
  287 | int degree(int n){
      |     ^~~~~~
a.cc:780:5: error: redefinition of 'int shishagonyu(double)'
  780 | int shishagonyu( double x )
      |     ^~~~~~~~~~~
a.cc:298:5: note: 'int shishagonyu(double)' previously defined here
  298 | int shishagonyu( double x )
      |     ^~~~~~~~~~~
a.cc:786:5: error: redefinition of 'int roundUp(double)'
  786 | int roundUp(double n){
      |     ^~~~~~~
a.cc:304:5: note: 'int roundUp(double)' previously defined here
  304 | int roundUp(double n){
      |     ^~~~~~~
a.cc:795:5: error: redefinition of 'int roundDown(double)'
  795 | int roundDown(double n){
      |     ^~~~~~~~~
a.cc:313:5: note: 'int roundDown(double)' previously defined here
  313 | int roundDown(double n){
      |     ^~~~~~~~~
a.cc:800:5: error: redefinition of 'int roundOff(double)'
  800 | int roundOff(double n){
      |     ^~~~~~~~
a.cc:318:5: note: 'int roundOff(double)' previously defined here
  318 | int roundOff(double n){
      |     ^~~~~~~~
a.cc:813:5: error: redefinition of 'int gcd(int, int)'
  813 | int gcd (int m, int n){
      |     ^~~
a.cc:331:5: note: 'int gcd(int, int)' previously defined here
  331 | int gcd (int m, int n){
      |     ^~~
a.cc:826:4: error: redefinition of 'll lcm(ll, ll)'
  826 | ll lcm(ll m, ll n){
      |    ^~~
a.cc:344:4: note: 'll lcm(ll, ll)' previously defined here
  344 | ll lcm(ll m, ll n){
      |    ^~~
a.cc:835:6: error: redefinition of 'void prime_factorization(ll)'
  835 | void prime_factorization(ll n){
      |      ^~~~~~~~~~~~~~~~~~~
a.cc:353:6: note: 'void prime_factorization(ll)' previously defined here
  353 | void prime_factorization(ll n){
      |      ^~~~~~~~~~~~~~~~~~~
a.cc:870:5: error: redefinition of 'int Eratosthenes(int)'
  870 | int Eratosthenes(int n){
      |     ^~~~~~~~~~~~
a.cc:388:5: note: 'int Eratosthenes(int)' previously defined here
  388 | int Eratosthenes(int n){
      |     ^~~~~~~~~~~~
a.cc:892:6: error: redefinition of 'bool odd_even(int)'
  892 | bool odd_even(int num){
      |      ^~~~~~~~
a.cc:410:6: note: 'bool odd_even(int)' previously defined here
  410 | bool odd_even(int num){
      |      ^~~~~~~~
a.cc:902:11: error: redefinition of 'long long int modinv(long long int, long long int)'
  902 | long long modinv(long long a, long long m) {
      |           ^~~~~~
a.cc:420:1