F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

The dress rehearsal of opening ceremony

Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 91    Accepted Submission(s): 0


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
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-06 20:10:55, Gzip enabled