[TASK]:
You will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.

[INSTRUCTION]:
The following libraries are already included in the code.
```cpp
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <fstream>
#include <climits>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <bitset>
using namespace std;
```
Do not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.

[PSEUDOCODE]:
declare new array of integers fa with 202002 elements
sum is a new array of integers with 202002 elements
create and array of integers c with size 202002
function max with int arguments a and b that returns int
    if a is greater than b
        return a
    else
        return b as a result
end of the block
int function findfa with int argument x
    if fa[x] is equal to x
        return x
    else
        return the result of findfa(fa[x])
end of the block
function U with int arguments x and y
    rx is a new integer variable = findfa(x)
    declare integer ry = findfa(y)
    if rx is not equal to ry
        set fa[rx] to ry
        add sum[rx] to sum[ry]
    end of the block
end of the block
vis is an array of booleans with size 202002
declare vector of integers called vec
define the main function
    create integers n, m and k
    read variables n, m and k from the input
    remove all elements from vec
    for i from 0 to n inclusive
        assign i to fa[i]
        assign 1 to sum[i]
    end of the block
    for i = 0 to k exclusive, read from the input to c[i]
    declare new ints x and y
    for i = 0 to m exclusive
        read user input to x and y
        call U of x and y
    end of the block
    set first sizeof(vis) bytes at the pointer vis to 0
    for i = 0 to k exclusive, change the value of vis[findfa(c[i])] to 1
    create integer variable with name MAX with value -1
    create new long long called ans with value 0
    start for loop from i = 1 to n inclusive incrementing i
        if fa[i] is equal to i
            if vis[i] is equal to 1
                set MAX to max of MAX and sum[i]
            else
                push sum[i] to the vec
            add sum[i] * (sum[i] - 1) / 2 to ans
        end of the block
    end of the block
    declare integer len with value length of vec
    start for loop from i = 0 to len exclusive incrementing i
        start for loop from j = i + 1 to len exclusive, changing ans to the sum of ans and vec[i] * vec[j] on each iteration
        change ans to ans + vec[i] * MAX
    end of the block
    change ans to ans - m
    if ans is greater than 0
        print ans
    else
        print "0" to the standard output
    return to indicate successful execution
end of the block

[CODE]:

int fa[202002];
int sum[202002];
int c[202002];
int max(int a, int b) {
    if (a > b)
        return a;
    else
        return b;
}
int findfa(int x) {
    if (fa[x] == x)
        return x;
    else
        return findfa(fa[x]);
}
void U(int x, int y) {
    int rx = findfa(x);
    int ry = findfa(y);
    if (rx != ry) {
        fa[rx] = ry;
        sum[ry] += sum[rx];
    }
}
bool vis[202002];
vector<int> vec;
int main() {
    int n, m, k;
    cin >> n >> m >> k;
    vec.clear();
    for (int i = 0; i <= n; i++) {
        fa[i] = i;
        sum[i] = 1;
    }
    for (int i = 0; i < k; i++) cin >> c[i];
    int x, y;
    for (int i = 0; i < m; i++) {
        cin >> x >> y;
        U(x, y);
    }
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < k; i++) vis[findfa(c[i])] = 1;
    int MAX = -1;
    long long ans = 0;
    for (int i = 1; i <= n; i++) {
        if (fa[i] == i) {
            if (vis[i] == 1)
                MAX = max(MAX, sum[i]);
            else
                vec.push_back(sum[i]);
            ans += sum[i] * (sum[i] - 1) / 2;
        }
    }
    int len = vec.size();
    for (int i = 0; i < len; i++) {
        for (int j = i + 1; j < len; j++) { ans += vec[i] * vec[j]; }
        ans += vec[i] * MAX;
    }
    ans = ans - m;
    if (ans > 0)
        cout << ans << endl;
    else
        cout << "0" << endl;
    return 0;
}