📄 problem 1045.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0047)http://acm.zju.edu.cn/show_problem.php?pid=1045 -->
<HTML><HEAD><TITLE>Problem 1045</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<CENTER><IMG src="Problem 1045.files/logo.gif" align=center></IMG></CENTER>
<HR>
<CENTER><FONT color=blue size=+2>HangOver</FONT></CENTER>
<HR>
<CENTER><FONT color=green>Time limit:</FONT> 1 Seconds <FONT
color=green>Memory limit: </FONT>32768K </FONT><BR><FONT
color=green>Total Submit:</FONT> 7242 <FONT color=green>Accepted
Submit:</FONT> 3809 </CENTER>
<HR>
<P>How far can you make a stack of cards overhang a table? If you have one card,
you can create a maximum overhang of half a card length. (We're assuming that
the cards must be perpendicular to the table.) With two cards you can make the
top card overhang the bottom one by half a card length, and the bottom one
overhang the table by a third of a card length, for a total maximum overhang of
1/2 + 1/3 = 5/6 card lengths. In general you can make n cards overhang by 1/2 +
1/3 + 1/4 + ... + 1/(n + 1) card lengths, where the top card overhangs the
second by 1/2, the second overhangs tha third by 1/3, the third overhangs the
fourth by 1/4, etc., and the bottom card overhangs the table by 1/(n + 1). This
is illustrated in the figure below.</P>
<P align=center><IMG height=144 src="Problem 1045.files/showimg.gif" width=513>
</P>
<P align=left>The input consists of one or more test cases, followed by a line
containing the number 0.00 that signals the end of the input. Each test case is
a single line containing a positive floating-point number c whose value is at
least 0.01 and at most 5.20; c will contain exactly three digits.<BR><BR>For
each test case, output the minimum number of cards necessary to achieve an
overhang of at least c card lengths. Use the exact output format shown in the
examples.</P>
<P align=left><BR><B>Example
input:</B><BR><BR>1.00<BR>3.71<BR>0.04<BR>5.19<BR>0.00</P>
<P align=left><BR><B>Example output:</B><BR><BR>3 card(s)<BR>61 card(s)<BR>1
card(s)<BR>273 card(s) </P>
<HR>
<FONT color=green size=+1>Problem Source: </FONT><I>Mid-Central USA 2001</I>
<HR>
<CENTER><A href="http://acm.zju.edu.cn/submit.php?pid=1045">Submit</A>
<A href="http://acm.zju.edu.cn/list_problem.php?vol=1">Back</A>
<A
href="http://acm.zju.edu.cn/problem_status.php?pid=1045">Status</A> </CENTER>
<HR>
<CENTER>
<TABLE width="100%" border=0>
<TBODY>
<TR>
<TD align=right width="65%"><A href="http://acm.zju.edu.cn/"><FONT
color=red>Zhejiang University Online Judge</FONT></A> <A
href="http://acm.zju.edu.cn/"><FONT color=red>V1.0</FONT></A></TD>
<TD align=right width="35%"><A href="http://www.zzhang.cn/"><FONT
color=#ffffff
size=-3>Book</FONT></A></TD></TR></TBODY></TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -