📄 1003 -- hangover.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0049)http://acm.pku.edu.cn/JudgeOnline/problem?id=1003 -->
<HTML><HEAD><TITLE>1003 -- Hangover</TITLE>
<META http-equiv=Pragma content=no-cache>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE type=text/css>A {
TEXT-DECORATION: none
}
A:hover {
COLOR: red; TEXT-DECORATION: underline
}
</STYLE>
<META content="MSHTML 6.00.2900.2523" name=GENERATOR></HEAD>
<BODY vLink=blue aLink=blue link=blue bgColor=#f1f1fd leftMargin=5><A
name=top></A>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#ffffff width=980
border=1><TBODY>
<TR>
<TD align=middle colSpan=5><IMG height=97
src="1003 -- Hangover.files/logo.jpg" width=980 border=0></TD></TR>
<TR vAlign=top align=middle bgColor=#6589d1>
<TH width=196>Online Judge</TH>
<TH width=196>Problem Set</TH>
<TH width=196>Authors</TH>
<TH width=197>Online Contests</TH>
<TH width=197>User</TH></TR>
<TR vAlign=top align=middle bgColor=#f1f1fd>
<TD><A href="http://acm.pku.edu.cn/JudgeOnline/bbs">Web Board</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/">Home Page</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/faq.htm"
target=_blank>F.A.Qs</A><BR>Announcement</TD>
<TD>
<FORM action=gotoproblem method=get><A
href="http://acm.pku.edu.cn/JudgeOnline/problemlist">Problems</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/submit">Submit Problem</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/status">Status
(Online)</A><BR><FONT color=blue>Prob.ID:</FONT><INPUT size=6 name=pid><INPUT type=submit value=Go name=pb1></FORM></TD>
<TD>
<FORM action=searchuser method=get><A
href="http://acm.pku.edu.cn/JudgeOnline/register">Register</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/modifyuser">Update your
info</A><BR><A href="http://acm.pku.edu.cn/JudgeOnline/userlist">Authors
ranklist</A><BR><INPUT size=10 name=key><INPUT type=submit value=Search name=B1></FORM></TD>
<TD><FONT color=#1a5cc8>Current Contest</FONT><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/pastcontests">Past
Contests</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/contests">Scheduled
Contests</A><BR><A
href="http://acm.pku.edu.cn/JudgeOnline/awardcontest_announce.htm"
target=_blank><FONT color=red>Award Contest</FONT></A></TD>
<TD align=left>Welcome<BR><A
href="http://acm.pku.edu.cn/JudgeOnline/userstatus?user_id=fjnu_jxd_009"
target=_parent><B>fjnu_jxd_009</B></A> <A
href="http://acm.pku.edu.cn/JudgeOnline/login?action=logout&url=/JudgeOnline/problem?id=1003">Log
Out</A><BR><A href="http://acm.pku.edu.cn/JudgeOnline/mail"
target=_parent><FONT
color=blue>Mail:1(<B>0</B>)</FONT></A></TD></TR></TBODY></TABLE>
<TABLE width="100%" background="1003 -- Hangover.files/table_back.jpg"
border=0><TBODY>
<TR>
<TD>
<P align=center><FONT color=blue size=5>Hangover</FONT> <BR>Time
Limit:1000MS Memory Limit:10000K<BR>Total Submit:13757 Accepted:5678
</P>
<P><FONT color=blue size=5>Description</FONT><BR><FONT
face="Times New Roman" size=3>
<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 <TT>+</TT> 1/3 <TT>=</TT> 5/6 card
lengths. In general you can make <I>n</I> cards overhang by 1/2 <TT>+</TT>
1/3 <TT>+</TT> 1/4 <TT>+</TT> ... <TT>+</TT> 1/(<I>n</I> <TT>+</TT> 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/(<I>n</I> <TT>+</TT> 1). This
is illustrated in the figure below.</P><BR>
<CENTER><IMG height=115 src="1003 -- Hangover.files/hangover.jpg"
width=424></CENTER><BR></FONT>
<P></P>
<P><FONT color=blue size=5>Input</FONT><BR><FONT face="Times New Roman"
size=3>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.</FONT></P>
<P><FONT color=blue size=5>Output</FONT><BR><FONT face="Times New Roman"
size=3>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.</FONT></P>
<P><FONT color=blue size=5>Sample Input</FONT><BR><FONT
face="Times New Roman" size=3><PRE>1.00
3.71
0.04
5.19
0.00
</PRE></FONT>
<P></P>
<P><FONT color=blue size=5>Sample Output</FONT><BR><FONT
face="Times New Roman" size=3><PRE>3 card(s)
61 card(s)
1 card(s)
273 card(s)</PRE></FONT>
<P></P>
<P><FONT color=blue size=5>Source</FONT><BR><FONT face="Times New Roman"
size=3>Mid-Central USA 2001</FONT></P></TD></TR></TBODY></TABLE><FONT
color=#333399 size=3>
<P align=center>[<A
href="http://acm.pku.edu.cn/JudgeOnline/submit?problem_id=1003">Submit</A>]
[<A href="javascript:history.go(-1)">Go Back</A>] [<A
href="http://acm.pku.edu.cn/JudgeOnline/problemstatus?problem_id=1003">Status</A>]
[<A href="http://acm.pku.edu.cn/JudgeOnline/bbs?problem_id=1003">Discuss</A>]
</FONT></P>
<P><IMG height=29 src="1003 -- Hangover.files/home.jpg" width=40 border=0><FONT
size=3><A href="http://acm.pku.edu.cn/JudgeOnline/">Home Page</A>
</FONT> <IMG height=29 src="1003 -- Hangover.files/goback.jpg"
width=40 border=0><FONT size=3><A href="javascript:history.go(-1)">Go
Back</A> <IMG height=29 src="1003 -- Hangover.files/top.jpg" width=40
border=0><A href="http://acm.pku.edu.cn/JudgeOnline/problem?id=1003#top">To
top</A></FONT><BR>
<HR>
<P align=center><FONT size=3>All Copyright Reserved 2003-2005 Ying Fuchen,Xu
Pengcheng<BR>Any problem, Please <A href="mailto:hawking@pku.edu.cn">Contact
Administrator</A></FONT></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -