Problem Description
Traditionally after the Local Contest, judges and contestants go to their favourite restaurant, Alfredos Pizza Restaurant. The contestants are really hungry after trying hard for five hours. To get their pizza as quickly as possible, they just decided to order one big pizza for all instead of several small ones. They wonder whether it is possible to put the big rectangular pizza on the surface of the round table such that it does not overhang the border of the table. Write a program that helps them!
 
Input
The input file contains several test cases. Each test case starts with an integer number r, the radius of the surface of the round table the contestants are sitting at. Input is terminated by r=0. Otherwise, 1 ≤ r ≤ 1000. Then follow 2 integer numbers w and l specifying the width and the length of the pizza, 1 ≤ w ≤ l ≤ 1000. 
 
Output
Output for each test case whether the ordered pizza will fit on the table or not. Adhere to the format shown in the sample output. A pizza which just touches the border of the table without intersecting it is considered fitting on the table, see example 3 for clarification. 
 
Sample Input
38 40 60
35 20 70
50 60 80
0
 
Sample Output
Pizza 1 fits on the table.
Pizza 2 does not fit on the table.
Pizza 3 fits on the table.
 
Source
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath> using namespace std; int main()
{
int r,a,b;
int t;
t = ;
while(scanf("%d",&r)!=EOF&&r!=&&scanf("%d%d",&a,&b)!=EOF)
{
if(r*r*>=a*a+b*b)
{
printf("Pizza %d fits on the table.\n",++t);
}
else
{
printf("Pizza %d does not fit on the table.\n",++t);
}
}
return ;
}

hdu2368Alfredo's Pizza Restaurant的更多相关文章

  1. HDU-2368 Alfredo's Pizza Restaurant

    http://acm.hdu.edu.cn/status.php Alfredo's Pizza Restaurant Time Limit: 1000/1000 MS (Java/Others)   ...

  2. 杭电ACM分类

    杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze ...

  3. TZOJ 2289 Help Bob(状压DP)

    描述 Bob loves Pizza but is always out of money. One day he reads in the newspapers that his favorite ...

  4. 转载:hdu 题目分类 (侵删)

    转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...

  5. CodeForces - 261B Maxim and Restaurant

    http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...

  6. Saddest's polar bear Pizza offered new YorkShire home

    Saddest:adj,可悲的,悲哀的,polar,两级的,极地额,YorkShire,约克郡 A UK wildlife park has confirmed that it is offering ...

  7. Pizza Pie Charts – 基于 Snap SVG 框架的响应式饼图

    Pizza Pie Charts 是一个基于 Adobe 的 Snap SVG 框架的响应式饼图插件.它着重于集成 HTML 标记和 CSS,而不是 JavaScript 对象,当然Pizza Pie ...

  8. Flo's Restaurant[HDU1103]

    Flo's Restaurant Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  9. Codeforces Testing Round #12 B. Restaurant 贪心

    B. Restaurant Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/597/problem ...

随机推荐

  1. uglifyjs入门接触

    一.背景 今天在看<锋利的jQuery>文时,突然看到Uglifyjs压缩工具,感觉值得一试(玩),所以网上稍微搜了一下资料,简单的运用了一下,发现入门非常简单,当然网上有很多在线压缩工具 ...

  2. 数据结构算法应用C++语言描述——(1)C++基础知识

    一.二维数组 (1)二维数组的列是固定时,行未知时使用动态分配 当一个二维数组每一维的大小在编译时都是已知时,可以采用类似于创建一维数组的语法 来创建二维数组.例如,一个类型为char的7×5数组可用 ...

  3. Fedora下用Iptux,中文乱码解决

    Ubuntu/Fedora下用Iptux与Windows下大飞鸽传书,中文乱码解决 问题描述: 在Ubuntu/Fedora下安装了Iptux后,再往Windows机器上发送文件或消息时,如果有中文, ...

  4. Sublime Text 3中使用正则表达式删除空行

    Sublime Text 3 中使用正则表达式删除空行 Ctrl+H Find What: \n\n+ Replace With:\n

  5. 在Vim中查看文件编码

    :set fileencoding 即可显示文件编码格式. 如果你只是想查看其它编码格式的文件或者想解决 用Vim查看文件乱码的问题,那么在 ~/.vimrc 文件中添加以下内容: set encod ...

  6. css基础之 语法

    CSS 实例 CSS 规则由两个主要的部分构成:选择器,以及一条或多条声明: 选择器通常是您需要改变样式的 HTML 元素. 每条声明由一个属性和一个值组成. 属性(property)是您希望设置的样 ...

  7. python 基础篇(一)--linux命令篇

    期末下一门考试还有些时间,那就来看看python的视频吧,基于python2.7.6,用的是xubuntu(vm搭建虚拟机). 先花了2,3个小时安装了xubuntu,配置了搜狗输入法,gedit也配 ...

  8. yii中使用active record进行关联显示

    model中: view中:

  9. Oracle EBS-SQL (QA-2):检查接收未检验.SQL

    SELECT rsh.receipt_num                                                       收据号,         pov.vendor ...

  10. ISSkin 使用技巧,WinXP 下的窗口阴影

    原文 http://restools.hanzify.org/article.asp?id=109 是否觉得在使用 ISSkin 的时候感觉窗口太过平板,尤其对于那些窗口边缘和窗口内部颜色一致的皮肤尤 ...