编程介的小学生 2017-05-26 15:33 采纳率: 20.5%
浏览 744
已采纳

The dress rehearsal of opening ceremony

Problem Description
As we all known, the Beijing Olympic Games had been hold in Aug 8th,2008.We are all excited about the opening ceremony directed by Yimou Chang. But how many people can taste the difficulties and the tears during the dress rehearsal.
I know we must have a deep impression to the performance named “Print”, finally it displays the Chinese word “和”, which means our Chinese people love peace and harmony. Yimou tells me that there are many actresses in the play, each one has a number from 1, 9, ... to 9^m(0<=m<2^31). Those whose number’s first digit is 9, will stand to make up the “和” at last, while others will squat. The total number of people who make up the “和” is N. Maybe N is too big, so let N=N%249+2.
Another moving story, there are N small circles on the ground. Each circle stands an actress. The N small circles form a big circle. At the beginning, the actresses play around the big circle clockwise. That means one actress jumped to the adjacent small circle in colckwise of the small circle she is now in. But clever Yimou find that after N times, every actress will be back to her original place. The time is too short. In order to lengthen the time of the performance, he changes his mind. Yimou also sets N arrows on the ground. Each small circle is just the start of a arrow and the end of another arrow. No circle has the same arrow’s start and end. Every actress jumps to the next circle along the direction of the arrow. When all the actresses return to their original circle, their performance ends. Now Yimou wants to know the maximal steps they can have. If you know the answer, please call “110” to tell Yimou, I think you will get a BIG surprise!

Input
There are multiple test cases. Each case only have an interger m. Process to the End Of File.

Output
For each case, output the final answer in one line.

Sample Input
1
23

Sample Output
3
4

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-06-14 16:12
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突