TopCoder

abcabcabc
快去寫 TIOJ 2311 > <

User's AC Ratio

80.0% (4/5)

Submission's AC Ratio

50.0% (5/10)

Tags

Description

妁艷和楓音邊走邊聊著剛剛發生的事,兩人臉上都掛著笑容。

突然,楓音被某種繩子纏住了,「妁艷小心阿!這是陷阱!啊啊啊啊~」,仔細一看那不是繩子而是觸手。「觸感好噁心呀!」楓音求救著

妁艷聽得不知該如何是好。「真是個笨蛋!你連著個簡單的陷阱都解不開嗎?」小嘍莉指著旁邊的三根柱子。

上面擺了N個大小不一的盤子(pants),根據小嘍莉的提示那似乎是移動到一半的蘿莉塔,「像你這種低賤的生物怎麼可能把蘿莉塔從第x步走到第y步呢?」

妁艷能夠輕鬆解開這個陷阱嗎?還是楓音會被帶入觸手深淵之中呢?

Input Format

第1行有t代表有t個蘿莉塔
接下來t行每行包含3個正整數N,x,y
限制:
t<2200
1<=N<18446744073709551616
1<=x<=y<18446744073709551616
x,y不會大於完成蘿莉塔的步數
y-x<=1000

Output Format

對每個詢問輸出當有N件盤子在最少步的移動法中第x步到第y步的移動方法(格式請參照範例輸出)
回答完每個詢問請留一行空白行

Sample Input 1

2
3 2 4
64 18446744073709551614 18446744073709551615

Sample Output 1

#2 : move the pants from #1 to #2
#3 : move the pants from #3 to #2
#4 : move the pants from #1 to #3

#18446744073709551614 : move the pants from #1 to #3
#18446744073709551615 : move the pants from #2 to #3

Hints

3層蘿莉塔的全部步驟

#1 : move the pants from #1 to #3
#2 : move the pants from #1 to #2
#3 : move the pants from #3 to #2
#4 : move the pants from #1 to #3
#5 : move the pants from #2 to #1
#6 : move the pants from #2 to #3
#7 : move the pants from #1 to #3
注意是pants而不是dish

Problem Source

原TIOJ1761 / problem setter:fenzhang

Subtasks

No. Testdata Range Score
1 0 50
2 1 50

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 3500 65536 262144 1
1 3500 65536 262144 2