当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3475: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
输出样例
1
1

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3475

最后修改于 2020-10-29T07:02:32+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 131072