1,3,4 queries correctly working. before doing some optimizations
query 3 pair selection done with vector. little bit slower than priority queue after all