{"problem":{"name":"[蓝桥杯 2018 省 B] 螺旋折线","description":{"content":"如图所示的螺旋折线经过平面上所有整点恰好一次。 ![](https://cdn.luogu.com.cn/upload/image_hosting/yis43t6j.png) 对于整点 $(X, Y)$，我们定义它到原点的距离 $\\text{dis}(X, Y)$ 是从原点到 $(X, Y)$ 的螺旋折线段的长度。   例如 $\\text{dis}(0, 1)=3$，$\\text{dis}(","description_type":"Markdown"},"platform":"Luogu","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":{"LuoguStyle":"P2"},"is_remote":true,"is_sync":true,"sync_url":null,"sign":"LGP8668"},"statements":[{"statement_type":"Markdown","content":"如图所示的螺旋折线经过平面上所有整点恰好一次。\n\n![](https://cdn.luogu.com.cn/upload/image_hosting/yis43t6j.png)\n\n对于整点 $(X, Y)$，我们定义它到原点的距离 $\\text{dis}(X, Y)$ 是从原点到 $(X, Y)$ 的螺旋折线段的长度。  \n\n例如 $\\text{dis}(0, 1)=3$，$\\text{dis}(-2, -1)=9$。 \n\n给出整点坐标 $(X, Y)$，你能计算出 $\\text{dis}(X, Y)$ 吗？\n\n## Input\n\n$X$ 和 $Y$。\n\n## Output\n\n输出 $\\text{dis}(X, Y)$\n\n[samples]\n\n## Note\n\n对于 $40\\%$的数据，$-1000\\le X,Y\\le 1000$。\n\n对于 $70\\%$ 的数据，$-10^5\\le X,Y \\le 10^5$。\n\n对于 $100\\%$ 的数据，$-10^9\\le X,Y \\le 10^9$。","is_translate":false,"language":"English"}],"meta":{"iden":"LGP8668","tags":["数学","2018","蓝桥杯省赛"],"sample_group":[["0 1","3"]],"created_at":"2026-03-03 11:09:25"}}