import bisect for _ in range(int(input())): N, M = map(int, input().split()) A = sorted(list(map(int, input().split()))) B = sorted(list(map(int, input().split()))) cnt = 0 for a in A: cnt += (bisect.bisect_left(B, a)) #왼쪽의 index를 반환, 같은 case를 고려하면 bisect_left가 맞다 print(cnt) https://www.acmicpc.net/problem/7795 7795번: 먹을 것인가 먹힐 것인가 심해에는 두 종류의 생명체 A와 B가 존재한다. A는 B를 먹는다. A는 자기보다 크기가 작은 먹이만 먹을 수 있다..