{"problem":{"name":"[ICPC 2024 Xi'an I] Chained Lights","description":{"content":" You have $n$ lights in a row. Initially, they are all off.                You are going to press these $n$ lights one by one. When you press light $i$, light $i$ will switch its state, which means it","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":1048576},"difficulty":{"LuoguStyle":"P2"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP10565"},"statements":[{"statement_type":"Markdown","content":"You have $n$ lights in a row. Initially, they are all off.\n    \n    \n    \nYou are going to press these $n$ lights one by one. When you press light $i$, light $i$ will switch its state, which means it will turn on if it's off and turn off if it's on, and then for every $j$ satisfied $i|j,i< j\\le n$, press light $j$ once.\n    \n    \n    \nFor example, if $n=4$, when you press light $1$, light $1$ will turn on, and then you will press light $2,3,4$. Since you pressed light $2$, light $2$ will turn on and you will press light $4$, which will cause light 4 to turn on. After all the operations, lights $1,2,3$ will be turned on and light $4$ is still off.\n    \n    \n    \nYou will press these $n$ lights and do the operations as mentioned above one by one. After all the operations, you want to know whether light $k$ is on or off.\n    \n    \n    \nYou can also use the following code to understand the meaning of the problem:\n\n```cpp\nvoid press(int x)\n{\n    light[x]^=1;\n    for (int y=x+x;y<=n;y+=x) press(y);\n}\nfor (int i=1;i<=n;i++) press(i);\n```\n\n## Input\n\nThere are multiple testcases.\n    \n    \n    \nThe first line contains an integer $T(1\\le T\\le10^5)$, which represents the number of testcases.\n    \n    \n    \nEach of the testcases contains two integers $n,k(1\\le k\\le n\\le10^6)$ in a single line.\n\n## Output\n\n    \n    \nFor each testcase, if light $k$ is turned on in the end, output $\\text{YES}$, otherwise output $\\text{NO}$.\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"LGP10565","tags":["2024","O2优化","ICPC","西安"],"sample_group":[["2\n1 1\n3 2","YES\nNO"]],"created_at":"2026-03-03 11:09:25"}}