天天看点

[2012山东省第三届ACM大学生程序设计竞赛]——Fruit Ninja II

fruit ninja ii

题目:

time limit: 5000ms memory limit: 65536k 有疑问?点这里^_^

题目描述

[2012山东省第三届ACM大学生程序设计竞赛]——Fruit Ninja II

have you ever played a popular game named "fruit ninja"?

fruit ninja (known as fruit ninja hd on the ipad and fruit ninja thd for nvidia tegra 2 based android devices) is a video game developed by halfbrick. it was released april 21, 2010 for ipod touch and iphone devices, july 12, 2010 for the ipad, september 17,

2010 for android os devices. fruit ninja was well received by critics and consumers. the ios version sold over 200,000 copies in its first month. by march 2011 total downloads across all platforms exceeded 20 million. it was also named one of time magazine‘s

50 best iphone apps of 2011.

[2012山东省第三届ACM大学生程序设计竞赛]——Fruit Ninja II

"swipe your finger across the screen to deliciously slash and splatter fruit like a true ninja warrior. be careful of bombs - they are explosive to touch and will put a swift end to your juicy adventure!" - as it described on http://www.fruitninja.com/, in

fruit ninja the player slices fruit with a blade controlled via a touch pad. as the fruit is thrown onto the screen, the player swipes their finger across the screen to create a slicing motion, attempting to slice the fruit in parts. extra points are awarded

for slicing multiple fruits with one swipe, and players can use additional fingers to make multiple slices simultaneously. players must slice all fruit; if three pieces of fruit are missed the game ends. bombs are occasionally thrown onto the screen, and will

also end the game should the player slice them.

maybe you are an excellent player of fruit ninja, but in this problem we focus on something more mathematically. consider a certain slicing trace you create on the touch pad, you slice a fruit (an apple or a banana or something else) into two parts at once.

can you figure out the volume of each part?

[2012山东省第三届ACM大学生程序设计竞赛]——Fruit Ninja II

impossible task? 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 polar radius oc is always

equals to it‘s equatorial radius ob. formally, we can get this kind of solid by revolving a certain ellipse on the x-axis. and the slicing trace the player created (represented as mn in illustration iii) is a line parallel to the x-axis. the slicing motion

slice the watermelon into two parts, and the section (shown as the dark part in illustration iii) is parallel to plane x-o-y.

given the length of oa, ob, om (om is the distance between the section and plane x-o-y), your task is to figure out the volume of the bigger part.

输入

there are multiple test cases. first line is an integer t (t ≈ 100), indicating the number of test cases.

for each test case, there are three integers: a, b, h, corresponding the length of oa, ob, om. you may suppose that 0 < b <= a <= 100 and 0 <= h <= 100.

输出

output case number "case %d: " followed by a floating point number (round to 3) 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

提示

in case 4, h is larger than b, which simply represent a miss.

http://www.fruitninja.com/

http://en.wikipedia.org/wiki/fruit_ninja

http://en.wikipedia.org/wiki/ellipsoid

来源

2012年"浪潮杯"山东省第三届acm大学生程序设计竞赛

水果忍者!

恩,就是切水果的小游戏。

给你一个椭圆形,它的ob与oc是相等的。。。

然后给你一个h,距离椭圆形中心的位置oh,刀切在这个平面上,

计算切完后,体积较大的部分的体积。

或许刚看到题,觉得是计算几何。

但是,这是解析几何,甚至就是完完全全高数题啊o(╯□╰)o

高数书上的例题,有木有。。。

三重积分的说。。。

就是这样,恩。