if let T = Int(readLine() ?? ""), let n = Int(readLine() ?? ""), let inputA = readLine(), let A = inputA.split(separator: " ").compactMap({Int($0)}) as? [Int], let m = Int(readLine() ?? ""), let inputB = readLine(), let B = inputB.split(separator: " ").compactMap({Int($0)}) as? [Int], A.count == n , B.count == m { var countSumB = [Int: Int]() for i in 0..