Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int t;
- cin>>t;
- while(t--)
- {
- int n, m;
- cin>>n>>m;
- vector<int> a(m);
- for(auto &e: a)
- cin>>e;
- long long int suma = accumulate(a.begin(), a.end(), 0ll);
- long long int tot = ((n*1ll*(n+1))/2);
- cout<<tot - suma<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment