编程介的小学生 2019-08-05 22:20 采纳率: 20.5%
浏览 81

化妆舞会上的一个计算的问题怎么用C来实现程序的

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

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题