Time Limit: 5000MS Memory limit: 65536K

题目描述

Haveyou ever played a popular game named "Fruit Ninja"?



Fruit Ninja (known as Fruit Ninja HD on the iPad and Fruit Ninja THD for NvidiaTegra 2 based Android devices) is a video game developed by Halfbrick. It wasreleased April 21, 2010 for iPod Touch and iPhone devices, July 12, 2010 forthe iPad, September 17, 2010
for Android OS devices. Fruit Ninja was wellreceived by critics and consumers. The iOS version sold over 200,000 copies inits first month. By March 2011 total downloads across all platforms exceeded 20million. It was also named one of Time magazine's 50 Best
iPhone Apps of 2011.

"Swipeyour finger across the screen to deliciously slash and splatter fruit like atrue ninja warrior. Be careful of bombs - they are explosive to touch and willput a swift end to your juicy adventure!" - As it described
onhttp://www.fruitninja.com/, in Fruit Ninja the player slices fruit with a bladecontrolled via a touch pad. As the fruit is thrown onto the screen, the player swipestheir finger across the screen to create a slicing motion, attempting to slicethe fruit in
parts. Extra points are awarded for slicing multiple fruits withone swipe, and players can use additional fingers to make multiple slicessimultaneously. Players must slice all fruit; if three pieces of fruit aremissed the game ends. Bombs are occasionally
thrown onto the screen, and willalso end the game should the player slice them.



Maybe you are an excellent player of Fruit Ninja, but in this problem we focus onsomething more mathematically. Consider a certain slicing trace you create onthe touch pad, you slice a fruit (an apple or a banana or something else) intotwo parts at once. Can
you figure out the volume of each part?

Impossibletask? Let us do some simplification by define our own Fruit Ninja game.

In our new Fruit Ninja game, only one kind of fruit will be thrown into the air- watermelon. What's more, the shape of every watermelon is a special Ellipsoid(details reachable at http://en.wikipedia.org/wiki/Ellipsoid) that it's polarradius OC is always equals
to it's equatorial radius OB. Formally, we can getthis kind of solid by revolving a certain ellipse on the x-axis. And theslicing trace the player created (represented as MN in Illustration III) is aline parallel to the x-axis. The slicing motion slice the
watermelon into twoparts, and the section (shown as the dark part in Illustration III) is parallelto plane x-O-y.



Given the length of OA, OB, OM (OM is thedistance between the section and plane x-O-y), your task is to figure out thevolume of the bigger part.

输入

Thereare multiple test cases. First line is an integer T (T ≈ 100), indicating thenumber of test cases.



For each test case, there are three integers: a, b, H, corresponding the lengthof OA, OB, OM. You may suppose that0 < b <= a <= 100 and 0 <= H <= 100.

输出

Outputcase number "Case %d: " followed by a floating point number (round to3) for each test case.

示例输入

4

2 2 0

2 2 1

2 2 2

2 2 3

示例输出

Case 1: 16.755

Case 2: 28.274

Case 3: 33.510

Case 4: 33.510

时间紧急,图片处理的不是太好,大家将就看吧

/***********************

刚看这个题目确实被吓到了,仔细看了以后你会发现这就是一个高数上的三重积分的问题。

求椭球缺的体积参考:http://zhidao.baidu.com/link?url=VGl0sArergv86msYl9wilJwfMk29d--x2frRo0pNEkRoY7-3K2r5sbL-aR15Vcd_VwKLU2xpmEMFUgGVq7SI1K

椭球长半轴 a ,短半轴 b ,高 h,(h 就是 题中 的 h)

则椭球缺体积可以这样求:(Word 里的数学符号不能显示,截个图片吧)

PI 为圆周率

然后用这个体积加上半球的体积就OK了。。

公式: V = 2/3*PI*a*b*b+PI *a*(b*h—h^3/(3*b))

Code:

#include <iostream>
#include<stdio.h>
using namespace std;
const double PI = 3.14159265358; //PI = 3.1415926535 时 WA,所以注意精度
int main()
{
int t,count = 1;;
double a,b,h,V;
scanf("%d",&t);
while(t--)
{
scanf("%lf%lf%lf",&a,&b,&h);
if(h>=b)
h = b;
V = 2.0/3.0*PI*a*b*b+PI*a*b*h-PI*a*h*h*h/(3.0*b);
printf("Case %d: ",count++);
printf("%.3lf\n",V);
}
return 0;
}

Sdut 2416 Fruit Ninja II(山东省第三届ACM省赛 J 题)(解析几何)的更多相关文章

  1. sdut 2416:Fruit Ninja II(第三届山东省省赛原题,数学题)

    Fruit Ninja II Time Limit: 5000MS Memory limit: 65536K 题目描述 Have you ever played a popular game name ...

  2. SDUT 2416:Fruit Ninja II

    Fruit Ninja II Time Limit: 5000MS Memory limit: 65536K 题目描述 Have you ever played a popular game name ...

  3. Sdut 2409 The Best Seat in ACM Contest(山东省第三届ACM省赛 H 题)(模拟)

    题目描述 Cainiao is a university student who loves ACM contest very much. It is a festival for him once ...

  4. 山东省第三届ACM省赛

    Solved ID PID Title Accepted Submit   A 2407 Impasse (+) 0 0   B 2415 Chess 0 0   C 2414 An interest ...

  5. sdut2408 pick apples (贪心+背包)山东省第三届ACM省赛

    版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/svitter/article/details/24642587 本文出自:http://blog.c ...

  6. 青岛理工ACM交流赛 J题 数格子算面积

    数格子算面积 Time Limit: 1000MS Memory limit: 262144K 题目描述 给你一个多边形(用’\’和’/’表示多边形的边),求多边形的面积. 输入  第一行两个正整数h ...

  7. 福建工程学院第十四届ACM校赛J题题解

    第六集,想不到你这个浓眉大眼的都叛变革命了 题意: 给你两个只包含01的字符串S和T,问你在允许一次错误的情况下,T是否能成为S的子串 思路: 这个问题的解法挺多,我是用fft匹配的,也比较简单,针对 ...

  8. [原]sdut2624 Contest Print Server (大水+大坑)山东省第四届ACM省赛

    本文出自:http://blog.csdn.net/svitter 原题:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&am ...

  9. [2012山东省第三届ACM大学生程序设计竞赛]——n a^o7 !

    n a^o7 ! 题目:http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2413 Time Lim ...

随机推荐

  1. POJ1276 - Cash Machine(多重背包)

    题目大意 给定一个容量为M的背包以及n种物品,每种物品有一个体积和数量,要求你用这些物品尽量的装满背包 题解 就是多重背包~~~~用二进制优化了一下,就是把每种物品的数量cnt拆成由几个数组成,1,2 ...

  2. How to Kill All Processes That Have Open Connection in a SQL Server Database[关闭数据库链接 最佳方法] -摘自网络

    SQL Server database administrators may frequently need in especially development and test environmen ...

  3. Dynamics CRM 2011 2013-(An error occurred while opening mailbox xxx@xx.com Microsoft.Crm.Tools.Email.Providers.)

    An error occurred while opening mailbox  Microsoft.Crm.Tools.Email.Providers. Whenever I check how C ...

  4. CentOS搭建VSFTP

    1.先看看有没有安装 rpm -qa | grep vsftpd 如果没有提示,说明没有安装.接下来,我们安装一个ftp. 2.yum安装vsftpd: yum -y install vsftpd 安 ...

  5. hdoj 2803 The MAX【简单规律题】

    The MAX Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Sub ...

  6. Ⅸ.spring的点点滴滴--IObjectFactory与IFactoryObject的杂谈

    承接上文 ObjectFactory与IFactoryObject的杂谈 .net篇(环境为vs2012+Spring.Core.dll v1.31) public class parent { pu ...

  7. php连mssql中文乱码问题

    我在将一个aspx+mssql的系统做成php+mssql的系统时,感觉架构大不一样,aspx多是aspx页面+aspx.cs后台协同开发,多用可视化空间开发,而php我则选用了smarty模板,感觉 ...

  8. Python递归遍历目录下所有文件

    #自定义函数: import ospath="D:\\Temp_del\\a"def gci (path): """this is a stateme ...

  9. C socket demo

    一.服务端-server.c #include <stdio.h> #include <sys/socket.h> #include <arpa/inet.h> # ...

  10. jfinal获取当前访问路径和端口号

    public void generateSingleLicense() throws Exception { System.out.println(getRequest().getRequestURL ...