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. 网络攻击之二:XSS(之一是SQL注入,前面有文章)

    学习了 http://www.oschina.net/question/565065_57506 (这里做了转载 http://blog.csdn.net/stilling2006/article/d ...

  2. HNOI2008题目总结

    呜呼..NOI前一个月正式开始切BZOJ了……以后的题解可能不会像之前的零散风格了,一套题我会集中起来发,遇到一些需要展开总结的东西我会另开文章详细介绍. 用了一天的时间把HNOI2008这套题切了… ...

  3. git workflow常用命令

    git init git status git add readme.txt git add --all         Adds all new or modified files git comm ...

  4. 跨平台的神器RAD XE5 来啦!!!! XE5破解

    什么叫真正的跨平台,DELPHI经过这么长时间的洗礼,如今走上了夸平台的开发之路.希望RAD加油! 先去下一个XE5 再去下一个破解神器 一个破解BDS.exe的神器 开始吧.为了成功破解,请先将电脑 ...

  5. springMVC实现多文件上传

    <h2>上传多个文件 实例</h2> <form action="/workreport/uploadMultiFile.html" method=& ...

  6. C#发送手机验证码

    C#发送手机验证码,平台有很多,我就说说其中的1个平台 测试环境:.net2.0 测试效果:速度还可以,10秒内接收短信 1.去http://www.yuntongxun.com注册,会送8元测试金额 ...

  7. HDU 5327 Olympiad (水题)

    题意:beautiful数字定义为该数字中的十进制形式每一位都不同,给一个区间[L,R],求该区间中有多少个beautiful数字. 思路:数字不大,直接暴力预处理,再统计区间[1,i]有多少个,用c ...

  8. Mysql使用大全

    #登录数据库 mysql -hlocalhost -uroot -p; #修改密码 mysqladmin -uroot -pold password new; #显示数据库 show database ...

  9. XE7 - 程序图标及启动画面图片的注意事项

    还是继续昨晚写的,年前已经解决了这个问题,现在补记下.启动画面失真是本篇笔记的重点.搜索了很多文章,基本上大同小异,几乎都没怎么提及启动画面失真的问题.不知道是不是我的操作不对头,. Project ...

  10. 【英语】Bingo口语笔记(71) - shit系列