#include <bits/stdc++.h>
using namespace std;
int main() {
/* code here */
priority_queue<int>leftheap;
priority_queue<int,vector<int>,greater<int> >rightheap;
int t;
cin>>t;
while(t--)
{
int n,d;
cin>>n;
float m;
cin>>d;
m=d;
cout<<m<<" ";
leftheap.push(d);
n--;
while(n--)
{
cin>>d;
if(leftheap.size()>rightheap.size())
{
if(d<m){
rightheap.push(leftheap.top());
leftheap.pop();
leftheap.push(d);
}
else
{
rightheap.push(d);
}
m=(leftheap.top()+rightheap.top())/2.0;
}
else if(leftheap.size()==rightheap.size())
{
if(d<m)
{
leftheap.push(d);
m=leftheap.top();
}
else{
rightheap.push(d);
m=rightheap.top();
}
}
else{
if(d>m){
leftheap.push(rightheap.top());
rightheap.pop();
rightheap.push(d);
}
else
{
leftheap.push(d);
}
m=(leftheap.top()+rightheap.top())/2.0;
}
cout<<m<<" ";
}
cout<<endl;
}
return 0;
}
it give wrong ans