ZOJ 3866 - Cylinder Candy
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu
Description
Edward the confectioner is making a new batch of chocolate covered candy. Each candy center is shaped as a cylinder with radius r mm and height h mm.
The candy center needs to be covered with a uniform coat of chocolate. The uniform coat of chocolate is d mm thick.
You are asked to calcualte the volume and the surface of the chocolate covered candy.
Input
There are multiple test cases. The first line of input contains an integer T(1≤ T≤ 1000) indicating the number of test cases. For each test case:
There are three integers r, h, d in one line. (1≤ r, h, d ≤ 100)
Output
For each case, print the volume and surface area of the candy in one line. The relative error should be less than 10-8.
Sample Input
2 1 1 1 1 3 5
Sample Output
32.907950527415 51.155135338077 1141.046818749128 532.235830206285
迷失在幽谷中的鸟儿,独自飞翔在这偌大的天地间,却不知自己该飞往何方……
#include <iostream> #include <cmath> #include <stdio.h> #include <string> #include <cstring> #include <map> #include <set> #include <vector> #include <stack> #include <queue> #include <iomanip> #include <algorithm> #include <memory.h> #define PI acos(-1) using namespace std; int main() { int n; cin>>n; for(int i=0; i<n; i++) { double r,h,d; cin>>r>>h>>d; double v,s; v=2.0*PI*(d*d*r*PI/2.0+2.0/3.0*d*d*d+r*r*d)+(r+d)*(r+d)*h*PI; s=2.0*PI*(2*d*d+PI*r*d)+2*PI*r*r+2*PI*(r+d)*h; printf("%.12lf %.12lf\n",v,s); } return 0; }
ZOJ 3866 - Cylinder Candy的更多相关文章
- ZOJ - 3866 Cylinder Candy 【数学】
题目链接 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3866 思路 积分 参考博客 https://blog.csdn. ...
- zoj 3866
G - Cylinder Candy Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu Su ...
- Cylinder Candy(积分+体积+表面积+旋转体)
Cylinder Candy Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Edward the confectioner is ...
- Cylinder Candy(积分)
Cylinder Candy Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Edward the confectioner is ...
- 【ZOJ 3897】Candy canes//Fiddlesticks
题 题意 给你一串数,a1...an,从左到右每次让一个数减小c,如果这个数小于c,那就减为0.第n个数减小后,又从第一个开始从左到右.如果这次某个数减小到0,那就改变方向,如果遇到已经是0的,就跳过 ...
- ZOJ People Counting
第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ 3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=394 ...
- [LeetCode] Candy 分糖果问题
There are N children standing in a line. Each child is assigned a rating value. You are giving candi ...
- ZOJ 3686 A Simple Tree Problem
A Simple Tree Problem Time Limit: 3 Seconds Memory Limit: 65536 KB Given a rooted tree, each no ...
- ZOJ Problem Set - 1394 Polar Explorer
这道题目还是简单的,但是自己WA了好几次,总结下: 1.对输入的总结,加上上次ZOJ Problem Set - 1334 Basically Speaking ac代码及总结这道题目的总结 题目要求 ...
随机推荐
- 6.理解DispatcherServlet
DispatcherServlet的作用 DispatcherServlet是前端控制器设计模式的实现,提供Spring Web MVC的集中访问点,负责职责的分派, 且与Spring IoC容器无缝 ...
- linux 缺少动态连接库.so--cannot open shared object file: No such file or directory
error while loading shared libraries的解決方法 执行行程式時,如此遇到像下列這種錯誤: ./tests: error while loading shared l ...
- WAL
WAL record format typedef struct XLogRecord{pg_crc32 xl_crc; /* CRC for this record */XLogRe ...
- sdutoj 2607 Mountain Subsequences
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2607 Mountain Subsequence ...
- [原创]spring学习笔记:关于springsource-tool-suite插件的安装
1.首先我们得确定自己使用的eclipes的版本,具体方式:打开eclipes > help > About Eclipes > 点击eclipes的logo > 查看ecli ...
- 查看Linux服务器各种信息方法
有的时候需要搜集服务器的各种信息,比如cpu信息,内存信息,linux版本信息,安装的各种软件信息等等.下面总结几种主要指标的查看方法. 1. 查看Linux发行版信息 [root@pcmweb ~] ...
- java中创建线程的几种方法及区别
1,实现Runnable接口创建线程 特点: A:将代码和数据分开,形成清晰的模型 B:线程体run()方法所在的类可以从其它类中继承一些有用的属性和方法 C:有利于保持程序风格的一致性 2,继承Th ...
- Java Switch(String)
package shb.java.test; /** * switch支持字符串 * @Package:shb.java.test * @Description: * @author shaobn * ...
- mongo导出导入
导出例子: mongoexport -d test -c test -q '{sn:1}' -o test.dat 导入例子: mongoimport -d test -c students stud ...
- (转) 关于Oracle EBS邮件服务无法使用的报错
来源http://blog.itpub.net/23850820/viewspace-1060596/ 也可以检查如下网站:http://blog.sina.com.cn/s/blog_5b021b4 ...