[ICPC 2013 WF] Factors

Luogu
IDLGP10618
Time1000ms
Memory512MB
DifficultyP5
搜索2013O2优化剪枝ICPCWF
The fundamental theorem of arithmetic states that every integer greater than $1$ can be uniquely represented as a product of one or more primes. While unique, several arrangements of the prime factors may be possible. For example: - $10=2\times 5=5\times 2$; - $20=2\times 2\times 5=2\times 5\times 2=5\times 2\times 2$; Let $f(k)$ be the number of different arrangements of the prime factors of $k$. So $f(10) = 2$ and $f(20) = 3$. Given a positive number $n$, there always exists at least one number $k$ such that $f(k) = n$. We want to know the smallest such $k$. ## Input The input consists of at most $1 000$ test cases, each on a separate line. Each test case is a positive integer $n < 2^{63}$. ## Output For each test case, display its number $n$ and the smallest number $k > 1$ such that $f(k) = n$. The numbers in the input are chosen such that $k < 2^{63}$. [samples]
Samples
Input #1
1
2
3
105
Output #1
1 2
2 6
3 12
105 720
API Response (JSON)
{
  "problem": {
    "name": "[ICPC 2013 WF] Factors",
    "description": {
      "content": "The fundamental theorem of arithmetic states that every integer greater than $1$ can be uniquely represented as a product of one or more primes. While unique, several arrangements of the prime factors",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P5"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP10618"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "The fundamental theorem of arithmetic states that every integer greater than $1$ can be uniquely represented as a product of one or more primes. While unique, several arrangements of the prime factors...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments