A13907 | Circle Game
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Utkarsh is forced to play yet another one of Ashish's games. The game progresses turn by turn and as usual, Ashish moves first.
Consider the 2D plane. There is a token which is initially at $(0,0)$ . In one move a player must increase either the $x$ coordinate or the $y$ coordinate of the token by exactly $k$ . In doing so, the player must ensure that the token stays within a (Euclidean) distance $d$ from $(0,0)$ .
In other words, if after a move the coordinates of the token are $(p,q)$ , then $p^2 + q^2 \leq d^2$ must hold.
The game ends when a player is unable to make a move. It can be shown that the game will end in a finite number of moves. If both players play optimally, determine who will win.
Consider the 2D plane. There is a token which is initially at $(0,0)$ . In one move a player must increase either the $x$ coordinate or the $y$ coordinate of the token by exactly $k$ . In doing so, the player must ensure that the token stays within a (Euclidean) distance $d$ from $(0,0)$ .
In other words, if after a move the coordinates of the token are $(p,q)$ , then $p^2 + q^2 \leq d^2$ must hold.
The game ends when a player is unable to make a move. It can be shown that the game will end in a finite number of moves. If both players play optimally, determine who will win.
输入格式
The first line contains a single integer $t$ ( $1 \leq t \leq 100$ ) — the number of test cases.
The only line of each test case contains two space separated integers $d$ ( $1 \leq d \leq 10^5$ ) and $k$ ( $1 \leq k \leq d$ ).
The only line of each test case contains two space separated integers $d$ ( $1 \leq d \leq 10^5$ ) and $k$ ( $1 \leq k \leq d$ ).
输出格式
For each test case, if Ashish wins the game, print "Ashish", otherwise print "Utkarsh" (without the quotes).
输入输出样例
输入 #1
5 2 1 5 2 10 3 25 4 15441 33
输出 #1
Utkarsh Ashish Utkarsh Utkarsh Ashish
In the first test case, one possible sequence of moves can be
$(0, 0) \xrightarrow{\text{Ashish }} (0, 1) \xrightarrow{\text{Utkarsh }} (0, 2)$ .
Ashish has no moves left, so Utkarsh wins.

$(0, 0) \xrightarrow{\text{Ashish }} (0, 1) \xrightarrow{\text{Utkarsh }} (0, 2)$ .
Ashish has no moves left, so Utkarsh wins.

C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted