{"problem":{"name":"[GESP202406 二级] 平方之和","description":{"content":"小杨有 $n$ 个正整数 $a_1,a_2,\\dots,a_n$，他想知道对于所有的 $i (1\\le i\\le n)$，是否存在两个正整数 $x$ 和 $y$ 满足 $x\\times x+y \\times y=a_i$。","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":524288},"difficulty":{"LuoguStyle":"P1"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGB4002"},"statements":[{"statement_type":"Markdown","content":"小杨有 $n$ 个正整数 $a_1,a_2,\\dots,a_n$，他想知道对于所有的 $i (1\\le i\\le n)$，是否存在两个正整数 $x$ 和 $y$ 满足 $x\\times x+y \\times y=a_i$。\n\n## Input\n\n第一行包含一个正整数 $n$，代表正整数数量。\n之后 $n$ 行，每行包含一个正整数，代表 $a_i$。\n\n## Output\n\n对于每个正整数 $a_i$，如果存在两个正整数 $x$ 和 $y$ 满足 $x\\times x+y \\times y=a_i$，输出 `Yes`，否则输出 `No`。\n\n[samples]\n\n## Background\n\n对应的选择、判断题：<https://ti.luogu.com.cn/problemset/1150>\n\n## Note\n\n对于第一个正整数，存在 $1\\times 1+2 \\times 2=5$，因此答案为 `Yes`。\n\n对于全部数据，保证有 $1 \\le n \\le 10,1 \\le a_i \\le 10^6$。","is_translate":false,"language":"English"}],"meta":{"iden":"LGB4002","tags":["2024","循环结构","GESP"],"sample_group":[["2\n5\n4","Yes\nNo"]],"created_at":"2026-03-03 11:09:25"}}