{"problem":{"name":"Two Sequences 2","description":{"content":"Snuke has two number sequences $a$ and $b$, each of length $N$. The $i$\\-th number of $a$ is $a_i$, and that of $b$ is $b_i$. Using these sequences, he has decided to make a new sequence $c$ of length","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"keyence2021_a"},"statements":[{"statement_type":"Markdown","content":"Snuke has two number sequences $a$ and $b$, each of length $N$. The $i$\\-th number of $a$ is $a_i$, and that of $b$ is $b_i$.\nUsing these sequences, he has decided to make a new sequence $c$ of length $N$. For each $n$ such that $1 \\leq n \\leq N$, $c_n$, the $n$\\-th number of $c$, is the maximum value of $a_i b_j$ for a pair $(i,j)$ such that $1 \\leq i \\leq j \\leq n$. Formally, we have $c_n = \\max_{1 \\leq i \\leq j \\leq n} a_{i}b_{j}$.\nFind $c_1, c_2, \\ldots, c_{N}$.\n\n## Constraints\n\n*   All values in input are integers.\n*   $1 \\leq N \\leq 2 \\times 10^{5}$\n*   $1 \\leq a_i, b_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}$ $\\cdots$ $a_{N}$\n$b_{1}$ $b_{2}$ $\\cdots$ $b_{N}$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"keyence2021_a","tags":[],"sample_group":[["3\n3 2 20\n1 4 1","3\n12\n20\n\nWe have:\n\n*   $c_{1} = \\max(a_{1}b_{1}) = 3$;\n*   $c_{2} = \\max(a_{1}b_{1}, a_{1}b_{2},a_{2}b_{2}) = 12$;\n*   $c_{3} = \\max(a_{1}b_{1}, a_{1}b_{2}, a_{1}b_{3}, a_{2}b_{2},a_{2}b_{3},a_{3}b_{3}) = 20$."],["20\n715806713 926832846 890153850 433619693 890169631 501757984 778692206 816865414 50442173 522507343 546693304 851035714 299040991 474850872 133255173 905287070 763360978 327459319 193289538 140803416\n974365976 488724815 821047998 371238977 256373343 218153590 546189624 322430037 131351929 768434809 253508808 935670831 251537597 834352123 337485668 272645651 61421502 439773410 621070911 578006919","697457706539596888\n697457706539596888\n760974252688942308\n760974252688942308\n760974252688942308\n760974252688942308\n760974252688942308\n760974252688942308\n760974252688942308\n760974252688942308\n760974252688942308\n867210459214915026\n867210459214915026\n867210459214915026\n867210459214915026\n867210459214915026\n867210459214915026\n867210459214915026\n867210459214915026\n867210459214915026"]],"created_at":"2026-03-03 11:01:14"}}