当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
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
1 1
时间上限 | 内存上限 |
1000 | 131072 |