[ROIR 2020] 平方 (Day1)

Luogu
IDLGP9783
Time1000ms
Memory128MB
DifficultyP2
2020Special JudgeROIR(俄罗斯)
**译自 [ROIR 2020](http://neerc.ifmo.ru/school/archive/2019-2020.html) Day1 T1.** ***[Разность квадратов](http://neerc.ifmo.ru/school/archive/2019-2020/ru-olymp-regional-2020-day1.pdf),译者 ShineEternal*** 你参与了字符计算系统软件模块的开发,将用于求解一类特殊的丢番图方程,具体内容如下: 给定一个非负整数 $n$,正在开发的模块需要找到两个正整数 $x$ 和 $y$,使得 $x^2-y^2=n$,其中 $x,y$ 不超过 $2^{62}-1$。 你需要编写一个程序,对于给定的非负整数 $n$,求出两个自然数 $x$ 和 $y$,使得它们都不超过 $2^{62}-1$ 且其平方差为 $n$。 ## Input 一行一个整数 $n$。 ## Output 如果存在可能的 $x,y$,则打印两行,第一行为一个单独的字符串 `Yes`,第二行打印任意一组 $x,y$。 如果不存在则输出 `No`。 [samples] ## Note 对于 $100\%$ 的数据,$0\le n\le 2^{60}$。 | 任务编号 | $n$ | 分值 | | :------: | :--------------------: | :--: | | $1$ | $0 \leq n \leq 2^{10}$ | $10$ | | $2$ | $0 \leq n \leq 2^{20}$ | $20$ | | $3$ | $0 \leq n \leq 2^{30}$ | $30$ | | $4$ | $0 \leq n \leq 2^{60}$ | $40$ |
Samples
Input #1
3
Output #1
Yes
2 1
Input #2
2
Output #2
No
API Response (JSON)
{
  "problem": {
    "name": "[ROIR 2020] 平方 (Day1)",
    "description": {
      "content": "**译自 [ROIR 2020](http://neerc.ifmo.ru/school/archive/2019-2020.html) Day1 T1.** ***[Разность квадратов](http://neerc.ifmo.ru/school/archive/2019-2020/ru-olymp-regional-2020-day1.pdf),译者 ShineEternal**",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 131072
    },
    "difficulty": {
      "LuoguStyle": "P2"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP9783"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "**译自 [ROIR 2020](http://neerc.ifmo.ru/school/archive/2019-2020.html) Day1 T1.** ***[Разность квадратов](http://neerc.ifmo.ru/school/archive/2019-2020/ru-olymp-regional-2020-day1.pdf),译者 ShineEternal**...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments