Help me in solving TRMAG problem

My issue

Can someone please help me understand the logic of this problem?

My code

#include <bits/stdc++.h>
#define ll long long int 
using namespace std;

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--)
	{
	    ll n,k;
	    cin>>n>>k;
	    ll sum= n*(n+1)/2;
	        while(k--)
	        {
	            ll x;
	            cin>>x;
	            sum-=x;
	            
	        }
	        ll z;
	        cin>>z;
	        n= (n+1)/2 ;
	       // float  ans = float(sum)*float( float(n-z)/float(n));
	         
	       cout << fixed << showpoint << setprecision(4) << sum*1.0*((n - z)/(n*1.0)) << endl;
	}
	return 0;
}

Problem Link: TRMAG Problem - CodeChef