In 2N - 1 boxes there are apples and oranges. Your task is to choose N boxes so, that they will contain not less than half of all the apples and not less than half of all the oranges.

Input

The first input line contains one number T — amount of tests. The description of each test starts with a natural number N — amount of boxes. Each of the following 2N - 1 lines contains numbers ai and oi — amount of apples and oranges in the i-th box (0 ≤ ai, oi ≤ 109). The sum of N in all the tests in the input doesn't exceed 105. All the input numbers are integer.

Output

For each test output two lines. In the first line output YES, if it's possible to choose N boxes, or NO otherwise. If the answer is positive output in the second line N numbers — indexes of the chosen boxes. Boxes are numbered from 1 in the input order. Otherwise leave the second line empty. Separate the numbers with one space.

Examples

Input

2
2
10 15
5 7
20 18
1
0 0


Output

YES
1 3
YES
1

Source: codeforces | Difficulty: VERY_HARD
Tags: Sorting

Constructive algorithms


Solutions:
import sys
input = sys.stdin.readline
t = int(input())
for cs in range(t):
	n = int(input())
	arr = []
	for i in range(2 * n - 1):
		(a, b) = map(int, input().split())
		arr.append((a, b, i))
	arr.sort()
	res = []
	for i in range(0, len(arr), 2):
		if i + 1 < len(arr):
			if arr[i][1] > arr[i + 1][1]:
				res.append(arr[i][2] + 1)
			else:
				res.append(arr[i + 1][2] + 1)
		else:
			res.append(arr[i][2] + 1)
	print('YES')
	print(' '.join(map(str, res)))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def primes(n):
	sieve = [True] * n
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i]:
			sieve[i * i::2 * i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [i for i in range(3, n, 2) if sieve[i]]

def binomial_coefficient(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def powerOfK(k, max):
	if k == 1:
		return [1]
	if k == -1:
		return [-1, 1]
	result = []
	n = 1
	while n <= max:
		result.append(n)
		n *= k
	return result

def prefixSum(arr):
	for i in range(1, len(arr)):
		arr[i] = arr[i] + arr[i - 1]
	return arr

def divisors(n):
	i = 1
	result = []
	while i * i <= n:
		if n % i == 0:
			if n / i == i:
				result.append(i)
			else:
				result.append(i)
				result.append(n / i)
		i += 1
	return result

def kadane(a, size):
	max_so_far = 0
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def digitsSum(n):
	if n == 0:
		return 0
	r = 0
	while n > 0:
		r += n % 10
		n //= 10
	return r

def print_grid(grid):
	for line in grid:
		print(''.join(line))
from collections import Counter
import sys
import math
from math import gcd
for _ in range(int(input())):
	n = int(input())
	b = []
	t = 0
	for i in range(2 * n - 1):
		(u, v) = map(int, input().split())
		b.append((u, v, i + 1))
		t += v
	b = sorted(b, key=lambda x: x[0])
	eo = b[::2]
	oo = b[1::2] + [b[-1]]
	e_or = sum([e[1] for e in eo])
	o_or = sum([e[1] for e in oo])
	var = t // 2
	if t % 2 != 0:
		var += 1
	if e_or >= var:
		ind = [i[2] for i in eo]
		print('YES')
		print(*ind)
	elif o_or >= var:
		ind = [i[2] for i in oo]
		print('YES')
		print(*ind)
	else:
		print('NO')


import os, io
from sys import stdout
import collections
import math
from operator import itemgetter
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
from collections import Counter

def primes(n):
	sieve = [True] * n
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i]:
			sieve[i * i::2 * i] = [False] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [i for i in range(3, n, 2) if sieve[i]]

def binomial_coefficient(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def powerOfK(k, max):
	if k == 1:
		return [1]
	if k == -1:
		return [-1, 1]
	result = []
	n = 1
	while n <= max:
		result.append(n)
		n *= k
	return result

def prefixSum(arr):
	for i in range(1, len(arr)):
		arr[i] = arr[i] + arr[i - 1]
	return arr

def divisors(n):
	i = 1
	result = []
	while i * i <= n:
		if n % i == 0:
			if n / i == i:
				result.append(i)
			else:
				result.append(i)
				result.append(n / i)
		i += 1
	return result

def kadane(a, size):
	max_so_far = 0
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def digitsSum(n):
	if n == 0:
		return 0
	r = 0
	while n > 0:
		r += n % 10
		n //= 10
	return r

def print_grid(grid):
	for line in grid:
		print(''.join(line))
t = int(input())
for _ in range(t):
	n = int(input())
	boxes = []
	i = 0
	for _ in range(2 * n - 1):
		boxes.append(list(map(int, input().split())) + [i + 1])
		i += 1
	boxes = sorted(boxes, key=itemgetter(1))
	even = boxes[::2]
	odd = boxes[1::2] + [boxes[-1]]
	apples = sum([e[0] for e in boxes])
	halfapple = apples // 2
	if apples % 2 == 1:
		halfapple += 1
	aeven = sum([e[0] for e in even])
	aodd = sum([e[0] for e in odd])
	if aeven >= halfapple:
		print('YES')
		res = []
		for e in even:
			res.append(e[2])
		print(' '.join([str(e) for e in sorted(res)]))
	elif aodd >= halfapple:
		print('YES')
		res = []
		for e in odd:
			res.append(e[2])
		print(' '.join([str(e) for e in sorted(res)]))
	else:
		print('NO')


t = int(input())
while t:
	t = t - 1
	boxes = []
	n = int(input())
	num_box = 2 * n - 1
	for i in range(num_box):
		pair = input().split()
		apples = int(pair[0])
		oranges = int(pair[1])
		boxes.append((apples, oranges, i + 1))
	print('YES')
	boxes.sort(reverse=True)
	orange_boxes = list(zip(*boxes))[1]
	total_oranges = sum(orange_boxes)
	half_sum1 = sum(orange_boxes[::2])
	half_sum2 = sum(orange_boxes[1::2])
	index_list = list(list(zip(*boxes))[2])
	index_list1 = index_list[::2]
	index_list2 = index_list[1::2]
	index_list2.append(index_list1[0])
	if half_sum1 >= half_sum2:
		print(*index_list1, sep=' ')
	else:
		print(*index_list2, sep=' ')


t = int(input())
for _ in range(t):
	n = int(input())
	nums = []
	for i in range(2 * n - 1):
		(a, b) = map(int, input().split())
		nums.append([b, a, i + 1])
	nums = sorted(nums)[::-1]
	vals = [nums[0][2]]
	i = 1
	while i + 1 < len(nums):
		c = i
		if nums[i][1] < nums[i + 1][1]:
			c = i + 1
		vals.append(nums[c][2])
		i += 2
	print('YES')
	print(*vals)