Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
912 B
4
Indexable
Never
#include<bits/stdc++.h>
using namespace std; 
#define pb push_back
#define int long long
#define fi first
#define se second
#define vi vector<int>
#define si(x) ((int)(x).size())
#define fill(a,b) memset(a, b, sizeof(a))
#define all(x) (x).begin(), (x).end()
#define forr(i,e) for(int i = 0; i < e; i++)
#define forn(i,e) for(int i = e; i >= 0; i--)
#define INF 1e18
#define mod 1000000007





//------------------------------------------------CODE START HERE-------------------------------------------------------------------------
 
 
int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
  
    int t;
    cin>>t;
    while(t--){
        int n,m;
        cin>>n>>m;

        int sum=0;

        for(int i=0;i<m;i++){
            int temp;
            cin>>temp;
            sum+=temp;
        }

        int nsum=(n*(n+1))/2;

        cout<< nsum-sum<<endl;

    }
    


return 0;
}