{"problem":{"name":"A. k-th divisor","description":{"content":"You are given two integers _n_ and _k_. Find _k_\\-th smallest divisor of _n_, or report that it doesn't exist. Divisor of _n_ is any such natural number, that _n_ can be divided by it without remaind","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF762A"},"statements":[{"statement_type":"Markdown","content":"You are given two integers _n_ and _k_. Find _k_\\-th smallest divisor of _n_, or report that it doesn't exist.\n\nDivisor of _n_ is any such natural number, that _n_ can be divided by it without remainder.\n\n## Input\n\nThe first line contains two integers _n_ and _k_ (1 ≤ _n_ ≤ 1015, 1 ≤ _k_ ≤ 109).\n\n## Output\n\nIf _n_ has less than _k_ divisors, output _\\-1_.\n\nOtherwise, output the _k_\\-th smallest divisor of _n_.\n\n[samples]\n\n## Note\n\nIn the first example, number 4 has three divisors: 1, 2 and 4. The second one is 2.\n\nIn the second example, number 5 has only two divisors: 1 and 5. The third divisor doesn't exist, so the answer is _\\-1_.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"给定两个整数 $n$ 和 $k$。求 $n$ 的第 $k$ 小的约数，若不存在则报告。\n\n$n$ 的约数是指任何自然数，使得 $n$ 能被其整除而无余数。\n\n第一行包含两个整数 $n$ 和 $k$（$1 ≤ n ≤ 10^{15}$，$1 ≤ k ≤ 10^9$）。\n\n如果 $n$ 的约数个数少于 $k$ 个，请输出 _-1_。\n\n否则，输出 $n$ 的第 $k$ 小的约数。\n\n在第一个例子中，数字 $4$ 有三个约数：$1$、$2$ 和 $4$。第二个是 $2$。\n\n在第二个例子中，数字 $5$ 只有两个约数：$1$ 和 $5$。第三个约数不存在，因此答案为 _-1_。\n\n## Input\n\n第一行包含两个整数 $n$ 和 $k$（$1 ≤ n ≤ 10^{15}$，$1 ≤ k ≤ 10^9$）。\n\n## Output\n\n如果 $n$ 的约数个数少于 $k$ 个，请输出 _-1_。否则，输出 $n$ 的第 $k$ 小的约数。\n\n[samples]\n\n## Note\n\n在第一个例子中，数字 $4$ 有三个约数：$1$、$2$ 和 $4$。第二个是 $2$。在第二个例子中，数字 $5$ 只有两个约数：$1$ 和 $5$。第三个约数不存在，因此答案为 _-1_。","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ with $ 1 \\leq n \\leq 10^{15} $.  \nLet $ D(n) = \\{ d \\in \\mathbb{Z}^+ \\mid d \\mid n \\} $ be the set of positive divisors of $ n $, ordered increasingly: $ d_1 < d_2 < \\dots < d_{\\tau(n)} $, where $ \\tau(n) = |D(n)| $.  \nLet $ k \\in \\mathbb{Z}^+ $ with $ 1 \\leq k \\leq 10^9 $.\n\n**Constraints**  \n$ 1 \\leq n \\leq 10^{15} $,  \n$ 1 \\leq k \\leq 10^9 $.\n\n**Objective**  \nIf $ k > \\tau(n) $, output $ -1 $.  \nOtherwise, output $ d_k $, the $ k $-th smallest positive divisor of $ n $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF762A","tags":["math","number theory"],"sample_group":[["4 2","2"],["5 3","\\-1"],["12 5","6"]],"created_at":"2026-03-03 11:00:39"}}