|Online Judge||Problem Set||Authors||Online Contests||User|
Paper-, er, Transcript-Folding Game
Most recently, frkstyc has engaged himself busily in applying for admission to graduate schools abroad. Among all those tasks he has to complete, one is to prepare the transcripts to mail to the admission offices. Earlier, frkstyc ordered his transcripts from the university’s Educational Admnistration Division (EAD). As per the regulations of the EAD, upon claiming the transcripts in the EAD office, he had to fold the transcripts until they fit into the envelops provided by the EAD, which were later sealed and stamped at the scene. Having unwisely overestimated the actual number of transcripts required, he ordered twice as many transcripts as needed, which left him with a very uninteresting and fatiguing paper-folding game. Finishing the work, he swore to himself that never again would he trouble himself with applications for admission aboard.
To help you better understand frkstyc’s experience folding his transcripts, consider this problem: given the dimensions of an envelop and a transcript, how many times does the transcript have to be folded until its dimensions do not exceed those of the envelop? Remember that frkstyc was preparing the transcripts for the review of faculty members in admission commitees, which required him to fold the transcripts either horizontally or vertically each time, halving its size. Additionally, the transcript must not lie slanted in the envelop.
The input contains multiple test cases each occupying one line. Each test case consists of four integers a, b, c, d (0 < a, b, c, d ≤ 231 − 1) indicating that the dimension of an envelop is a × b and that of a transcript is c × d. Process until EOF is met.
For each test case, output the minimum number of times a transcript has to be folded.
1 2 1 4 2 1 1 4
[Submit] [Go Back] [Status] [Discuss]
Home Page Go Back To top
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator