Hard problem

题目链接:

http://acm.split.hdu.edu.cn/showproblem.php?pid=5858

Description


cjj is fun with math problem. One day he found a Olympic Mathematics problem for primary school students. It is too difficult for cjj. Can you solve it?
![](http://images2015.cnblogs.com/blog/764119/201608/764119-20160818172426750-377270246.png)
Give you the side length of the square L, you need to calculate the shaded area in the picture.
The full circle is the inscribed circle of the square, and the center of two quarter circle is the vertex of square, and its radius is the length of the square.

Input


The first line contains a integer T(1

Output


For each test case, print one line, the shade area in the picture. The answer is round to two digit.

Sample Input


1
1

Sample Output


0.29

Source


2016 Multi-University Training Contest 10


##题意:

求阴影面积.


##题解:

本渣不会算,只好百度搜图...
(http://f.hiphotos.baidu.com/zhidao/pic/item/83025aafa40f4bfbde8267a0024f78f0f63618f7.jpg)
(http://zhidao.baidu.com/question/571519797?&oldq=1)

![](http://images2015.cnblogs.com/blog/764119/201608/764119-20160818172723937-1109865998.png)


##代码:
/*注释部分的公式也可以*/
``` cpp
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define LL long long
#define eps 1e-8
#define maxn 110
#define mod 100000007
#define inf 0x3f3f3f3f
#define mid(a,b) ((a+b)>>1)
#define IN freopen("in.txt","r",stdin);
using namespace std;

int main(int argc, char const *argv[])

{

//IN;

int t; cin >> t;
while(t--)
{
double a; scanf("%lf", &a); //double ans = a*a/4.0 * asin(sqrt(14.0)/4.0);
//ans -= a*a * asin(sqrt(14.0)/8.0);
//ans += a*a * sqrt(7.0) / 8.0;
//ans *= 2.0; double ans = atan(sqrt(7.0)) / 4.0;
ans -= atan(sqrt(7.0)/5.0);
ans += sqrt(7.0) / 8.0;
ans *= a*a*2.0; printf("%.2f\n", ans);
} return 0;

}

HDU 5858 Hard problem (数学推导)的更多相关文章

  1. hdu 5105 Math Problem(数学)

    pid=5105" target="_blank" style="">题目链接:hdu 5105 Math Problem 题目大意:给定a.b ...

  2. hdu 5312 Sequence(数学推导——三角形数)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5312 Sequence Time Limit: 2000/2000 MS (Java/Others)  ...

  3. HDU 5858 Hard problem

    Hard problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Tota ...

  4. hdu 5312 Sequence(数学推导+线性探查(两数相加版))

    Problem Description Today, Soda has learned a sequence whose n-th (n≥) item )+. Now he wants to know ...

  5. hdu 5430 Reflect (数学推导题)

    Problem Description We send a light from one point on a mirror material circle,it reflects N times a ...

  6. HDU 5105 Math Problem --数学,求导

    官方题解: f(x)=|a∗x3+b∗x2+c∗x+d|, 求最大值.令g(x)=a∗x3+b∗x2+c∗x+d,f(x)的最大值即为g(x)的正最大值,或者是负最小值.a!=0时, g′(x)=3∗ ...

  7. HDU 5858 Hard problem ——(计算几何)

    其实这题最多是个小学奥数题- -,,看到别人博客各显神通,也有用微积分做的(我也试了一下,结果到最后不会积...). 思路如下(这两张图是网上找来的): 然后就很简单了,算三角形面积可以用海伦公式,也 ...

  8. HDU 5073 Galaxy(Anshan 2014)(数学推导,贪婪)

    Galaxy Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total S ...

  9. UVA - 10014 - Simple calculations (经典的数学推导题!!)

    UVA - 10014 Simple calculations Time Limit: 3000MS Memory Limit: Unknown 64bit IO Format: %lld & ...

随机推荐

  1. Jquery Highcharts 参数配置说明

    chart: renderTo 图表的页面显示容器 defaultSeriesType 图表的显示类型(line,spline, scatter, splinearea bar,pie,area,co ...

  2. win32窗口机制之CreateWindow

    CreateWindow     函数功能:该函数创建一个重叠式窗口.弹出式窗口或子窗口.它指定窗口类,窗口标题,窗口   风格,以及窗口的初始位置及大小(可选的).该函数也指定该窗口的父窗口或所属窗 ...

  3. yaf框架流程四

    在前面的章节,在bootstrap里添加了一个benchmark插件,简单介绍下yaf的插件机制:http://yaf.laruence.com/manual/yaf.plugin.html Yaf定 ...

  4. php 系统命令执行函数

    (转载)作者:海底苍鹰地址:http://blog.51yip.com/php/1064.html 1,exec函数 <?php $test = "ls /tmp/test" ...

  5. jQuery基础知识--Form基础(续)

    下拉框应用 <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF ...

  6. Func<T, TResult> 委托的由来和调用和好处(为了高大上,为了白富美)

    Func<T, TResult>是系统的内置委托的中最常用的一个.特点就是必须有一个返回值.(func委托有多个重载,所有重载的最后一个参数就是返回值的类型,前面的是参数类型).注:没有返 ...

  7. 看来ms sql server if 中定义个变量出了if 还是可以用的

    begin declare @abc int; end print @abc 可以打出1出来

  8. android 拦截事件

    在做布局文件时,经常会有布局组件压在其它组件上面,这样点击上面布局没有控件的部分就会点中下面布局的控件. 如何拦截事件不让事件传递到下一层呢? 布局组件onTouchEvent() 用于处理事件,返回 ...

  9. 什么时候用copy什么时候用retain (一)

    在声明一个property的时候总是搞不清什么时候用retain,什么时候用copy,用上去了感觉也不会错,但是又没有安全感: Copy:顾名思义,复制,将对象复制一份,ios内部的操作时,先copy ...

  10. mysql 插入汉字出现问号 解决方法

    mysql中文显示乱码或者问号是因为选用的编码不对或者编码不一致造成的,最简单的方法就是修改mysql的配置文件my.cnf.在[mydqld]和[client]段加入 default-charact ...