# SHSPOONS shifting spoons JANUARYLUNCHTIME WRONG ANSWER :(

``````#include <bits/stdc++.h>
using namespace std;
int main() {
long long int t;std::cin >> t;
while(t--){
priority_queue<pair<long long int,long long int>, vector<pair<long long int,long long int>>, greater<pair<long long int,long long int>>>heap;
long long int n;std::cin >> n;

for(long long int i=1;i<n;i++){
long long int x;std::cin >> x;
heap.push({x,i});
}
std::vector<pair<long long int,long long int>>answer;//kahas , kitna
bool canbe=true;
while(heap.size()){
long long int hel = heap.top().first;long long int kaha=heap.top().second;
heap.pop();
}
else{
canbe=false;break;
}
}
if(canbe==false){
std::cout << -1 << std::endl;
}
else{
}
}
}
return 0;
}
``````

I used heaps with pairs such that one can only add small no to the first number but i am getiing WA. kindly help me find out where is my mistake actually .
thankyou

Your solution is wrong and also you had to print three value and not two . See my explanation and code for the question.

printed three values only , in my solution i will send elements to 1 one only.
see carefully

Ok I saw , The solution is wrong , see my solution and explanation for clearing.

Try for

3
3 4 5

yea i got it. thanks , wrong logic