UVA 10209 Is This Integration ?
来源:互联网 发布:存钱不如存人 知乎 编辑:程序博客网 时间:2024/06/06 13:04
Is This Integration ?
Input: Standard Input
Output: Standard Output
Time Limit: 3 seconds
In the image below you can see a square ABCD, where AB = BC = CD = DA = a. Four arcs are drawn taking the four vertexesA, B, C, D as centers and a as the radius. The arc that is drawn takingA as center, starts at neighboring vertex B and ends at neighboring vertexD. All other arcs are drawn in a similar fashion. Regions of three different shapes are created in this fashion. You will have to determine the total area if these different shaped regions.
Input
The input file contains a floating-point number a (a>=0 a<=10000) in each line which indicates the length of one side of the square. Input is terminated by end of file.
Output
For each line of input, output in a single line the total area of the three types of region (filled with different patterns in the image above). These three numbers will of course be floating point numbers with three digits after the decimal point. First number will denote the area of the striped region, the second number will denote the total area of the dotted regions and the third number will denote the area of the rest of the regions.
Sample Input:
0.2
0.3
Sample Output:
0.013 0.020 0.007
0.028 0.046 0.016
#include <cstdio>#include <cstdlib>#include <cstring>#include <iostream>#include <cmath>#include <algorithm>#define Pi acos(-1)using namespace std;int main(){double a;while (~scanf("%lf",&a)){double s=0,x,y,z;s=sqrt(3.0)*a*a/4.0+Pi*a*a/6.0;z=4*(a*a-s);y=4*(a*a-Pi*a*a/4-z/2);x=a*a-z-y;printf("%.3lf %.3lf %.3lf\n",x,y,z);}return 0;}
- uva 10209 Is This Integration?
- [uva] 10209 - Is This Integration ?
- UVA 10209 - Is This Integration
- UVA 10209 Is This Integration ?
- UVa 10209 - Is This Integration ?
- UVa Problem 10209 Is This Integration? (需要积分吗?)
- UVA 10209(Is This Integration ?-容斥原理)
- uva 10209 Is This Integration ? (计算几何)
- UVa 10209 Is This Integration ?(计算几何)
- UVA 343 What Base Is This?
- UVa 11479 - Is this the easiest problem?
- UVa 343 - What Base Is This?
- uva 343 What Base Is This?
- maven Integration is disabled
- Materialized View Integration Is Over
- Continuous Integration is your best friend
- Integration
- This is a test
- nyoj-722 数独(深搜,哈希)
- gstreamer 核心源码source创建和识别typefind原理浅析(一) .
- 11.20数据结构----图的存储结构
- xcode5编译过的xib 如何在xcode4.6下打开
- JAVA/JSP/Servlet获取当前工程路径-绝对路径
- UVA 10209 Is This Integration ?
- show engine innodb status显示信息不全?
- 解释:主存、辅存、Cache、RAM、SRAM、DRAM、ROM、PROM、EPROM、EEPROM、CDROM、Flash Memory。
- 近期任务
- gstreamer核心源码走读typefind原理浅析(二) .
- 22.C++类的共享
- 获得ip地理信息的几种方法【最全】
- java获取有线网络的ip地址 与mac地址
- gstreamer核心源码走读typefind原理和对象关系浅析(三)