编程介的小学生 2017-09-06 09:33 采纳率: 20.5%
浏览 906
已采纳

ACM

alsomagic often has unexpected gains from his strolling around.

One day, he found a magical machine, on which there was an expression "Automatic Card-interpret Machine (ACM)-TYPE N". Oh.....it was a machine used to read cards. beside of the ACM, there were a great many cards labeled 0, 1, 2 ... alsomagic counted it again and again, then found the total of them is 2^N...oh, good heavens! What were they used to do?

Piquant alsomagic was so curious that he put a card with number k into ACM, but the machine showed that he must input the passwords! alsomagic had no idea. So he guest and try some number, wonder happened---he shoot it!!! A beautiful photo of a ppmm came out from the ACM... So pp ...

alsomagic was very exited and he was so careful that he found some words on the screen:" The password of card k/2 + (k%2)*2^(N-1) is XXXXXX." By seeing these alsomagic put the card whose number is k/2 + (k%2)*2^(N-1) into ACM and another photo of ppmm appeared! And some other words were shown on the screen too:" The password of... "

How many cards' password should poor alsomagic at least know if he wanted to see all of the photos?

Input

This problem consists of several test cases. Each case consists of exactly one line containing an integer N (0 < N <= 200), which indicates the ACM's type. A case with N = 0 means the end of test, which should not be proceeded.

Output

For each test case you should just output a single number perline.

Sample Input

2
3
0

Sample Output

3
4

  • 写回答

1条回答

  • threenewbee 2017-09-20 15:43
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题