📄 problem - 1056.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0046)http://acm.hdu.edu.cn/showproblem.php?pid=1056 -->
<HTML><HEAD><TITLE>Problem - 1056</TITLE>
<META
content="HDOJ ACM ICPC Online Judge HDU Hangzhou Dianzi University Programming C C++ Pascal Java"
name=keywords>
<META content="杭州电子科技大学 在线判题系统 在线评判系统 杭电 大学生程序设计竞赛" name=keywords>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
media=all href="Problem - 1056_files/global.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.3790.2858" name=GENERATOR></HEAD>
<BODY><A name=top></A>
<TABLE style="TABLE-LAYOUT: fixed; WORD-WRAP: break-word" cellSpacing=0
cellPadding=0 width=980 align=center border=0>
<TBODY>
<TR>
<TD
style="BORDER-RIGHT: #1a5cc8 1px solid; BORDER-TOP: #1a5cc8 1px solid; BORDER-LEFT: #1a5cc8 1px solid; BORDER-BOTTOM: #1a5cc8 1px solid"
align=middle width="100%"><A href="http://acm.hdu.edu.cn/"><IMG height=116
alt="HDU Online Judge" src="Problem - 1056_files/banner.jpg" width="100%"
border=0></A></TD></TR>
<TR>
<TD
style="BORDER-RIGHT: #1a5cc8 1px solid; BORDER-TOP: #1a5cc8 1px solid; BORDER-LEFT: #1a5cc8 1px solid; BORDER-BOTTOM: #1a5cc8 1px solid">
<TABLE cellSpacing=0 cellPadding=1 width="100%">
<TBODY>
<TR class=banner align=middle bgColor=#1a5cc8 height=25>
<TD>Online Judge</TD>
<TD>Problem Set</TD>
<TD>Authors</TD>
<TD>Online Contests</TD>
<TD>Exercise Author</TD></TR>
<TR style="FONT-SIZE: 16px" align=middle>
<TD vAlign=top width="20%"><A
href="http://acm.hdu.edu.cn/notification.php">Notification</A><BR><A
href="http://acm.hdu.edu.cn/faq.php">F.A.Q</A><BR><A
href="http://acm.hdu.edu.cn/forum">Forum</A><BR><A
href="http://acm.hdu.edu.cn/blog">Blog</A><BR><A
href="http://acm.hdu.edu.cn/admin">Administration</A> </TD>
<TD vAlign=top width="20%"><A
href="http://acm.hdu.edu.cn/listproblem.php?vol=1">Problem
Archive</A><BR><A href="http://acm.hdu.edu.cn/submit.php">Submit
Solution</A><BR><A href="http://acm.hdu.edu.cn/status.php">Realtime
Judge Status</A>
<FORM style="MARGIN: 6px 0px 0px" action=/search.php
method=get><INPUT type=hidden value=problem name=field> <INPUT
class=text60 name=key> <INPUT class=button40 type=submit value=Search> </FORM></TD>
<TD vAlign=top width="20%"><A
href="http://acm.hdu.edu.cn/register.php">Register New
Author</A><BR><A href="http://acm.hdu.edu.cn/modifyuser.php">Update
Your Information</A><BR><A
href="http://acm.hdu.edu.cn/ranklist.php">Authors Ranklist</A>
<FORM style="MARGIN: 6px 0px 0px" action=/search.php
method=get><INPUT type=hidden value=author name=field> <INPUT
class=text60 name=key> <INPUT class=button40 type=submit value=Search> </FORM></TD>
<TD vAlign=top width="20%"><A
href="http://acm.hdu.edu.cn/contests/contest_show.php?cid=80"><FONT
color=red>Current Contest</FONT></A><BR><A
href="http://acm.hdu.edu.cn/contests/contest_list.php?type=scheduled">Scheduled
Contests</A><BR><A
href="http://acm.hdu.edu.cn/contests/contest_list.php?type=passed">Passed
Contests</A> </TD>
<TD width="20%">
<FORM style="MARGIN: 3px 0px 0px"
action=/userloginex.php?action=login method=post>
<TABLE cellSpacing=0 width=168 align=center border=0>
<TBODY>
<TR>
<TD width=68>Author ID </TD>
<TD align=right><INPUT class=text90 maxLength=20
name=username></TD></TR>
<TR>
<TD>Password </TD>
<TD align=right><INPUT class=text90 type=password maxLength=20
name=userpass></TD></TR>
<TR>
<TD align=middle colSpan=2 height=43><INPUT class=button40 type=submit value="Sign In" name=login> <A
href="http://acm.hdu.edu.cn/register.php">Register new
ID</A></TD></TR></TBODY></TABLE></FORM></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=middle><BR>
<H1 style="COLOR: #1a5cc8">HangOver</H1><FONT size=+0><B><SPAN
style="FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: green; FONT-FAMILY: Arial">Time
Limit: 2000/1000 MS (Java/Others) Memory Limit:
65536/32768 K (Java/Others)<BR>Total Submission(s):
998 Accepted Submission(s):
287<BR></SPAN></B></FONT><BR><BR>
<DIV class=panel_title align=left>Problem Description</DIV>
<DIV class=panel_content>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.<BR><BR><IMG
src="Problem - 1056_files/1056-1.gif"> <BR><BR>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.<BR></DIV>
<DIV class=panel_bottom> </DIV><BR>
<DIV class=panel_title align=left>Sample Input</DIV>
<DIV class=panel_content><PRE>1.00
3.71
0.04
5.19
0.00</PRE></DIV>
<DIV class=panel_bottom> </DIV><BR>
<DIV class=panel_title align=left>Sample Output</DIV>
<DIV class=panel_content><PRE>3 card(s)
61 card(s)
1 card(s)
273 card(s)</PRE></DIV>
<DIV class=panel_bottom> </DIV><BR>
<DIV class=panel_title align=left>Source</DIV>
<DIV class=panel_content>Mid-Central USA 2001</DIV>
<DIV class=panel_bottom> </DIV><BR>
<CENTER
style="FONT-WEIGHT: bold; FONT-SIZE: 15px; COLOR: #1a5cc8; FONT-FAMILY: Arial"><A
href="http://acm.hdu.edu.cn/statistic.php?pid=1056">Statistic</A> | <A
href="http://acm.hdu.edu.cn/submit.php?pid=1056">Submit</A> | <A
href="http://acm.hdu.edu.cn/listproblem.php?vol=1">Back</A></CENTER><BR></TD></TR>
<TR>
<TD>
<TABLE
style="BORDER-RIGHT: #1a5cc8 1px solid; BORDER-TOP: #1a5cc8 1px solid; FONT-SIZE: 14px; BORDER-LEFT: #1a5cc8 1px solid; BORDER-BOTTOM: #1a5cc8 1px solid"
cellSpacing=0 cellPadding=1 width="100%">
<TBODY>
<TR>
<TD class=footer_link align=middle height=45><A
href="http://acm.hdu.edu.cn/">Home</A> | <A
href="http://acm.hdu.edu.cn/showproblem.php?pid=1056#top">Top</A></TD>
<TD
style="PADDING-RIGHT: 6px; PADDING-LEFT: 6px; PADDING-BOTTOM: 6px; PADDING-TOP: 6px"
align=middle>Hangzhou Dianzi University Online Judge<BR>Copyright ©
2005-2007 <A href="mailto:mailwrt@163.com" target=_blank>Wang
Rongtao</A>. All Rights Reserved.<BR>Any Problem, Please Contact <A
href="http://acm.hdu.edu.cn/team.php">Online Judge Team</A><BR><SPAN
style="FONT-SIZE: 11px; COLOR: green; FONT-FAMILY: Arial">Total
0.000999(s) query 1, Now is : 2007-05-20 15:56:40, Gzip enabled,
Version : 2.20</SPAN> </TD>
<TD class=footer_link align=middle><A
href="javascript:history.go(-1);">Back</A> | <A
href="javascript:history.go(1);">Forward</A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -