{"problem":{"name":"B. Yet Another Convolution","description":{"content":"You are given an integer array $a_1, \\\\dots, a_n$ and an integer array $b_1, \\\\dots, b_n$. You have to calculate the array $c_1, \\\\dots, c_n$ defined as follows: $$c_k = \\max\\limits_{\\gcd(i,j) = k} ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":6000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10235B"},"statements":[{"statement_type":"Markdown","content":"You are given an integer array $a_1, \\\\dots, a_n$ and an integer array $b_1, \\\\dots, b_n$.\n\nYou have to calculate the array $c_1, \\\\dots, c_n$ defined as follows:\n\n$$c_k = \\max\\limits_{\\gcd(i,j) = k} |a_i - b_j|\\text{.}$$\n\nThe first line of input contains a single integer $n$ ($1 <= n <= 10^5$).\n\nThe second line of input contains $n$ integers $a_1, \\\\dots, a_n$ ($1 <= a_i <= 10^9$).\n\nThe third line of input contains $n$ integers $b_1, \\\\dots, b_n$ ($1 <= b_i <= 10^9$).\n\nOutput $n$ integers $c_1, \\\\dots, c_n$.\n\n## Input\n\nThe first line of input contains a single integer $n$ ($1 <= n <= 10^5$).The second line of input contains $n$ integers $a_1, \\\\dots, a_n$ ($1 <= a_i <= 10^9$).The third line of input contains $n$ integers $b_1, \\\\dots, b_n$ ($1 <= b_i <= 10^9$).\n\n## Output\n\nOutput $n$ integers $c_1, \\\\dots, c_n$.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $, and let $ A = (a_1, \\dots, a_n) $, $ B = (b_1, \\dots, b_n) $ be sequences of integers.  \nDefine $ C = (c_1, \\dots, c_n) $, where for each $ k \\in \\{1, \\dots, n\\} $:  \n\n**Objective**  \n$$\nc_k = \\max_{\\substack{1 \\le i,j \\le n \\\\ \\gcd(i,j) = k}} |a_i - b_j|\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10235B","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}