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 first place of 2^n

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 921    Accepted Submission(s): 403


Problem Description
LMY and YY are mathematics and number theory lovers. They like to find and solve interesting mathematic problems together. One day LMY calculates 2n one by one, n=0, 1, 2,¡­ and writes the results on a sheet of paper: 1£¬2£¬4£¬8£¬16£¬32£¬64£¬128£¬256£¬512£¬1024£¬¡­¡­

LMY discovers that for every consecutive 3 or 4 results, there must be one among them whose first digit is 1, and comes to the conclusion that the first digit of 2n isn¡¯t evenly distributed between 1 and 9, and the number of 1s exceeds those of others. YY now intends to use statistics to prove LMY¡¯s discovery.
 

Input
Input consists of one or more lines, each line describing one test case: an integer N, where 0¡ÜN¡Ü10000.

End of input is indicated by a line consisting of -1.
 

Output
For each test case, output a single line. Each line contains nine integers. The ith integer represents the number of js satisfying the condition that 2j begins with i (0¡Üj¡ÜN).
 

Sample Input
0 1 3 10 -1
 

Sample Output
1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 1 0 4 2 1 1 1 1 0 1 0
 

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-02 05:26:30, Gzip enabled