[백준][Python] 1946번 신입 사원
import sys
T = int(sys.stdin.readline())
for t in range(T):
n = int(sys.stdin.readline())
score = []
for _ in range(n):
score.append(list(map(int,sys.stdin.readline().split())))
score = sorted(score,key=lambda x : x[0])
min_value = score[0][1]
count = 1
for i in range(1,len(score)):
if score[i][1] < min_value:
count += 1
min_value = score[i][1]
print(count)