{"problem":{"name":"Increasing Triples","description":{"content":"Given are three sequences of $N$ integers each: $A = (A_1, \\ldots, A_N),\\,B = (B_1, \\ldots, B_N),\\,C = (C_1, \\ldots, C_N)$. You can permute each of these sequences in any way you like. Find the maximu","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc123_b"},"statements":[{"statement_type":"Markdown","content":"Given are three sequences of $N$ integers each: $A = (A_1, \\ldots, A_N),\\,B = (B_1, \\ldots, B_N),\\,C = (C_1, \\ldots, C_N)$.\nYou can permute each of these sequences in any way you like. Find the maximum possible number of indices $i$ such that $A_i < B_i < C_i$ after permuting them.\n\n## Constraints\n\n*   $1\\leq N\\leq 10^5$\n*   $1\\leq A_i, B_i, C_i\\leq 10^9$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n$B_1$ $B_2$ $\\ldots$ $B_N$\n$C_1$ $C_2$ $\\ldots$ $C_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc123_b","tags":[],"sample_group":[["5\n9 6 14 1 8\n2 10 3 12 11\n15 13 5 7 4","3\n\nWe should permute them as follows:\n\n*   $A = (1,6,8,9,14)$,\n*   $B = (3,2,10,12,11)$,\n*   $C = (4,7,15,13,5)$.\n\nThen, we will have three indices $i$ ($i = 1, 3, 4$) such that $A_i < B_i < C_i$."],["1\n10\n20\n30","1"],["3\n1 1 1\n1 1 2\n2 2 2","0"]],"created_at":"2026-03-03 11:01:14"}}