{"problem":{"name":"Hit and Blow","description":{"content":"You are given integer sequences, each of length $N$: $A = (A_1, A_2, \\dots, A_N)$ and $B = (B_1, B_2, \\dots, B_N)$.   All elements of $A$ are different. All elements of $B$ are different, too. Print t","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc243_b"},"statements":[{"statement_type":"Markdown","content":"You are given integer sequences, each of length $N$: $A = (A_1, A_2, \\dots, A_N)$ and $B = (B_1, B_2, \\dots, B_N)$.  \nAll elements of $A$ are different. All elements of $B$ are different, too.\nPrint the following two values.\n\n1.  The number of integers contained in both $A$ and $B$, appearing at the same position in the two sequences. In other words, the number of integers $i$ such that $A_i = B_i$.\n2.  The number of integers contained in both $A$ and $B$, appearing at different positions in the two sequences. In other words, the number of pairs of integers $(i, j)$ such that $A_i = B_j$ and $i \\neq j$.\n\n## Constraints\n\n*   $1 \\leq N \\leq 1000$\n*   $1 \\leq A_i \\leq 10^9$\n*   $1 \\leq B_i \\leq 10^9$\n*   $A_1, A_2, \\dots, A_N$ are all different.\n*   $B_1, B_2, \\dots, B_N$ are all different.\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\dots$ $A_N$\n$B_1$ $B_2$ $\\dots$ $B_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc243_b","tags":[],"sample_group":[["4\n1 3 5 2\n2 3 1 4","1\n2\n\nThere is one integer contained in both $A$ and $B$, appearing at the same position in the two sequences: $A_2 = B_2 = 3$.  \nThere are two integers contained in both $A$ and $B$, appearing at different positions in the two sequences: $A_1 = B_3 = 1$ and $A_4 = B_1 = 2$."],["3\n1 2 3\n4 5 6","0\n0\n\nIn both `1.` and `2.`, no integer satisfies the condition."],["7\n4 8 1 7 9 5 6\n3 5 1 7 8 2 6","3\n2"]],"created_at":"2026-03-03 11:01:14"}}