{"problem":{"name":"B. Friendly Numbers","description":{"content":"Kiana thinks two integers are friends if and only if one of them divides the other one. For example, 12 and 4 are friends, also 6 and 6 are friends too, but 120 and 36 are not. A group of non-zero in","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF100B"},"statements":[{"statement_type":"Markdown","content":"Kiana thinks two integers are friends if and only if one of them divides the other one. For example, 12 and 4 are friends, also 6 and 6 are friends too, but 120 and 36 are not.\n\nA group of non-zero integers is called friendly, if each pair of its integers form a friend pair.\n\nYou are given a group of non-zero integers. See if they're friendly.\n\n## Input\n\nThe first line contains _n_ (1 ≤ _n_ ≤ 1000), where _n_ — the number of integers in the group.\n\nThe next line contains the elements, sorted in the non-decreasing order. The numbers are comma separated, they have at most 7 digits in their decimal notation and do not have any leading zeros.\n\n## Output\n\nIf the group is friendly write \"_FRIENDS_\", else write \"_NOT FRIENDS_\".\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"Kiana 认为两个整数是朋友，当且仅当其中一个能整除另一个。例如，12 和 4 是朋友，6 和 6 也是朋友，但 120 和 36 不是。\n\n一组非零整数被称为友好的，当且仅当其中每一对整数都构成朋友对。\n\n给定一组非零整数，请判断它们是否友好。\n\n第一行包含 #cf_span[n]（#cf_span[1 ≤ n ≤ 1000]），其中 #cf_span[n] 表示该组中整数的个数。\n\n第二行包含按非递减顺序排列的元素，数字以逗号分隔，每个数的十进制表示最多有 7 位数字，且没有前导零。\n\n如果该组是友好的，请输出 \"_FRIENDS_\"，否则输出 \"_NOT FRIENDS_\"。\n\n## Input\n\n第一行包含 #cf_span[n]（#cf_span[1 ≤ n ≤ 1000]），其中 #cf_span[n] 表示该组中整数的个数。第二行包含按非递减顺序排列的元素，数字以逗号分隔，每个数的十进制表示最多有 7 位数字，且没有前导零。\n\n## Output\n\n如果该组是友好的，请输出 \"_FRIENDS_\"，否则输出 \"_NOT FRIENDS_\"。\n\n[samples]","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ with $ 1 \\leq n \\leq 1000 $ be the number of integers.  \nLet $ A = (a_1, a_2, \\dots, a_n) $ be a sequence of non-zero integers, sorted in non-decreasing order, with $ |a_i| \\leq 10^7 $ for all $ i $.\n\n**Constraints**  \nFor all $ i \\in \\{1, \\dots, n\\} $, $ a_i \\neq 0 $ and $ a_i \\in \\mathbb{Z} $.\n\n**Objective**  \nDetermine whether for all pairs $ (i, j) $ with $ 1 \\leq i < j \\leq n $, either $ a_i \\mid a_j $ or $ a_j \\mid a_i $.  \nIf yes, output \"_FRIENDS_\"; otherwise, output \"_NOT FRIENDS_\".","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF100B","tags":["implementation"],"sample_group":[["4\n1,3,6,12","FRIENDS"],["3\n1,2,9","NOT FRIENDS"]],"created_at":"2026-03-03 11:00:39"}}