[문제 링크] : https://www.acmicpc.net/problem/1524#include using namespace std; int main(){ int T, N, M, inp; cin >> T; while(T--){ int a = 0, b = 0; cin >> N >> M; while(N--){ cin >> inp; a = max(a, inp); } while(M--){ cin >> inp; b = max(b, inp); } if(a >= b){ cout a){ cout