博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
codeforce897c Nephren gives a riddle
阅读量:5077 次
发布时间:2019-06-12

本文共 2322 字,大约阅读时间需要 7 分钟。

原题链接
What are you doing at the end of the world? Are you busy? Will you save us?

Nephren is playing a game with little leprechauns.

She gives them an infinite array of strings, f0... ∞.

f0 is "What are you doing at the end of the world? Are you busy? Will you save us?".

She wants to let more people know about it, so she defines fi =  "What are you doing while sending "fi - 1"? Are you busy? Will you send "fi - 1"?" for all i ≥ 1.

For example, f1 is

"What are you doing while sending "What are you doing at the end of the world? Are you busy? Will you save us?"? Are you busy? Will you send "What are you doing at the end of the world? Are you busy? Will you save us?"?". Note that the quotes in the very beginning and in the very end are for clarity and are not a part of f1.

It can be seen that the characters in fi are letters, question marks, (possibly) quotation marks and spaces.

Nephren will ask the little leprechauns q times. Each time she will let them find the k-th character of fn. The characters are indexed starting from 1. If fn consists of less than k characters, output '.' (without quotes).

Can you answer her queries?

Input

The first line contains one integer q (1 ≤ q ≤ 10) — the number of Nephren's questions.

Each of the next q lines describes Nephren's question and contains two integers n and k (0 ≤ n ≤ 105, 1 ≤ k ≤ 1018).

Output

One line containing q characters. The i-th character in it should be the answer for the i-th query.

Example

Input
3 1 1 1 2 1 111111111111
Output
Wh.
Input
5 0 69 1 194 1 139 0 47 1 66
Output
abdef
Input
10 4 1825 3 75 3 530 4 1829 4 1651 3 187 4 584 4 255 4 774 2 474
Output
Areyoubusy

Note

For the first two examples, refer to f0 and f1 given in the legend.

#include 
#define LL long long;using namespace std;const unsigned long long maxx = 1000000000000000005;string s0="What are you doing at the end of the world? Are you busy? Will you save us?";string part1 = "What are you doing while sending \"";string part2 = "\"? Are you busy? Will you send \"";string part3 = "\"?";long long len[100003];long long Min(long long xx,long long yy){ if(xx
=len[n]) return '.'; if(n==0) return s0[k]; if(k
>n>>k; cout<

 

转载于:https://www.cnblogs.com/--lr/p/7994814.html

你可能感兴趣的文章
监督学习模型分类 生成模型vs判别模型 概率模型vs非概率模型 参数模型vs非参数模型...
查看>>
Mobiscroll脚本破解,去除Trial和注册时间限制【转】
查看>>
实验五 Java网络编程及安全
查看>>
32位与64位 兼容编程
查看>>
iframe父子页面通信
查看>>
ambari 大数据安装利器
查看>>
java 上传图片压缩图片
查看>>
magento 自定义订单前缀或订单起始编号
查看>>
ACM_拼接数字
查看>>
计算机基础作业1
查看>>
Ubuntu 深度炼丹环境配置
查看>>
C#中集合ArrayList与Hashtable的使用
查看>>
从一个标准 url 里取出文件的扩展名
查看>>
map基本用法
查看>>
poj-1163 动态规划
查看>>
Golang之interface(多态,类型断言)
查看>>
Redis快速入门
查看>>
BootStrap---2.表格和按钮
查看>>
Linear Algebra lecture 2 note
查看>>
CRC计算模型
查看>>