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

Golden Radio Base

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1635    Accepted Submission(s): 661


Problem Description
Golden ratio base (GRB) is a non-integer positional numeral system that uses the golden ratio (the irrational number (1+¡Ì5)/2 ¡Ö 1.61803399 symbolized by the Greek letter ¦Õ) as its base. It is sometimes referred to as base-¦Õ, golden mean base, phi-base, or, phi-nary.

Any non-negative real number can be represented as a base-¦Õ numeral using only the digits 0 and 1, and avoiding the digit sequence "11" ¨C this is called a standard form. A base-¦Õ numeral that includes the digit sequence "11" can always be rewritten in standard form, using the algebraic properties of the base ¦Õ ¡ª most notably that ¦Õ + 1 = ¦Õ 2 . For instance, 11(¦Õ) = 100(¦Õ). Despite using an irrational number base, when using standard form, all on-negative integers have a unique representation as a terminating (finite) base-¦Õ expansion. The set of numbers which possess a finite base-¦Õ representation is the ring Z[1 + ¡Ì5/2]; it plays the same role in this numeral systems as dyadic rationals play in binary numbers, providing a possibility to multiply.

Other numbers have standard representations in base-¦Õ, with rational numbers having recurring representations. These representations are unique, except that numbers (mentioned above) with a terminating expansion also have a non-terminating expansion, as they do in base-10; for example, 1=0.99999¡­.

Coach MMM, an Computer Science Professor who is also addicted to Mathematics, is extremely interested in GRB and now ask you for help to write a converter which, given an integer N in base-10, outputs its corresponding form in base-¦Õ.
 

Input
There are multiple test cases. Each line of the input consists of one positive integer which is not larger than 10^9. The number of test cases is less than 10000. Input is terminated by end-of-file.
 

Output
For each test case, output the required answer in a single line. Note that trailing 0s after the decimal point should be wiped. Please see the samples for more details.
 

Sample Input
1 2 3 6 10
 

Sample Output
1 10.01 100.01 1010.0001 10100.0101
 

Hint
 

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-11-22 08:12:44, Gzip enabled