当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6043:KazaQ's Socks

题目描述
KazaQ wears socks everyday.

At the beginning, he has $n$ pairs of socks numbered from $1$ to $n$ in his closets.

Every morning, he puts on a pair of socks which has the smallest number in the closets.

Every evening, he puts this pair of socks in the basket. If there are $n - 1$ pairs of socks in the basket now, lazy KazaQ has to wash them. These socks will be put in the closets again in tomorrow evening.

KazaQ would like to know which pair of socks he should wear on the $k$-th day.
输入解释
The input consists of multiple test cases. (about $2000$)

For each case, there is a line contains two numbers $n, k$ $(2 \leq n \leq 10^9, 1 \leq k \leq 10^{18})$.
输出解释
For each test case, output "Case #$x$: $y$" in one line (without quotes), where $x$ indicates the case number starting from $1$ and $y$ denotes the answer of corresponding case.
输入样例
3 7
3 6
4 9
输出样例
Case #1: 3
Case #2: 1
Case #3: 2
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6043

最后修改于 2020-10-25T23:27:48+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 131072/131072K(Java/Others)