{"problem":{"name":"B. Beautiful Divisors","description":{"content":"Recently Luba learned about a special kind of numbers that she calls _beautiful_ numbers. The number is called _beautiful_ iff its binary representation consists of _k_ + 1 consecutive ones, and then ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF893B"},"statements":[{"statement_type":"Markdown","content":"Recently Luba learned about a special kind of numbers that she calls _beautiful_ numbers. The number is called _beautiful_ iff its binary representation consists of _k_ + 1 consecutive ones, and then _k_ consecutive zeroes.\n\nSome examples of beautiful numbers:\n\n*   12 (110);\n*   1102 (610);\n*   11110002 (12010);\n*   1111100002 (49610).\n\nMore formally, the number is beautiful iff there exists some positive integer _k_ such that the number is equal to (2_k_ - 1) * (2_k_ - 1).\n\nLuba has got an integer number _n_, and she wants to find its greatest beautiful divisor. Help her to find it!\n\n## Input\n\nThe only line of input contains one number _n_ (1 ≤ _n_ ≤ 105) — the number Luba has got.\n\n## Output\n\nOutput one number — the greatest beautiful divisor of Luba's number. It is obvious that the answer always exists.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"最近，Luba 学习了一种她称为 _beautiful_ 数的特殊数字。一个数字被称为 _beautiful_，当且仅当它的二进制表示由 #cf_span[k + 1] 个连续的 1，后跟 #cf_span[k] 个连续的 0 组成。\n\n一些 beautiful 数的例子：\n\n更形式化地说，一个数字是 beautiful 的，当且仅当存在某个正整数 #cf_span[k]，使得该数字等于 #cf_span[(2k - 1) * (2k - 1)]。\n\nLuba 得到了一个整数 #cf_span[n]，她希望找到它的最大的 beautiful 因子。请帮助她找到它！\n\n输入仅包含一行，包含一个数字 #cf_span[n]（#cf_span[1 ≤ n ≤ 105]）——Luba 得到的数字。\n\n输出一个数字——Luba 的数字的最大 beautiful 因子。显然答案总是存在的。\n\n## Input\n\n输入仅包含一行，包含一个数字 #cf_span[n]（#cf_span[1 ≤ n ≤ 105]）——Luba 得到的数字。\n\n## Output\n\n输出一个数字——Luba 的数字的最大 beautiful 因子。显然答案总是存在的。\n\n[samples]","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ k \\in \\mathbb{Z}^+ $. A number $ b_k $ is *beautiful* if:  \n$$\nb_k = (2^k - 1) \\cdot 2^{k-1}\n$$\n\n**Given**  \nAn integer $ n \\in \\mathbb{Z} $ such that $ 1 \\leq n \\leq 10^5 $.\n\n**Objective**  \nFind the greatest divisor $ d $ of $ n $ such that $ d = b_k $ for some $ k \\in \\mathbb{Z}^+ $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF893B","tags":["brute force","implementation"],"sample_group":[["3","1"],["992","496"]],"created_at":"2026-03-03 11:00:39"}}