Running medial problem

I have written the code but unable to write the input format can you please help me out??

#include
using namespace std;

class medianfinder{
public:
priority_queue<int,vector> maxheap;
priority_queue<int,vector,greater> minheap;

medianfinder(){

}

void addnum(int num){

	if(maxheap.empty() or maxheap.top()>num){
		maxheap.push(num);
	}else{
		minheap.push(num);
	}


	if(minheap.size()+1<maxheap.size()){
		minheap.push(maxheap.top());
		maxheap.pop();
	}

	else if(maxheap.size()+1<minheap.size()){
		maxheap.push(minheap.top());
		minheap.pop();			
	}
}


double median(){

	if(maxheap.size()==minheap.size()){

		if(maxheap.size()==0){
			return 0;
		}else{
			return (maxheap.top()+minheap.top())/2;
		}
	}


	else{
		return minheap.size()>maxheap.size() ? minheap.top():maxheap.top();
	}
}

};

int main() {

return 0;

}

my code

@ChiragJindal7
hello chirag,
in ur main function first read number of test cases (say t).
then iterate for t numbers of times and for each iteration read number of input in streams (say n)
and then read n inputs and print median.

int main(){
int t;
cin>>t;
for(int i=1;i<=t;i++){
int n;
cin>>n;
create object of median finder.
for(int j=1;j<=n;j++){
int c;
cin>>c;
insert in medianfinder
output median

}
}

}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.