#include<bits/stdc++.h>
using namespace std;
int t1,t2,s1,s2,w;
int get(int b)
{
int s=(s2-s1)*(t2-t1)*;
int d=s2-s1;
int y=s2-b;
if(y<=t1) return ;
if(y<=t1+d) return (y-t1)*(y-t1);
if(y<=t2) return d*(y-t1+y-t1-d);
if(y<=t2+d) return s-(t2+d-y)*(t2+d-y);
return s;
}
int main()
{
int T; scanf("%d",&T);
for(int i=;i<=T;i++)
{
scanf("%d %d %d %d %d",&t1,&t2,&s1,&s2,&w);
if(t2-t1<s2-s1) { swap(t1,s1); swap(t2,s2); }
int area=get(-w);
int num=get(w);
area-=num;
int s=(s2-s1)*(t2-t1)*;
printf("Case #%d: %.8f\n",i,area*1.0/s);
}
}

几何概型 uva11722的更多相关文章

  1. UVA 11722 几何概型

    第六周A题 - 几何概型 Time Limit:1000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu   Descriptio ...

  2. Codeforces - 77B - Falling Anvils - 几何概型

    https://codeforc.es/contest/77/problem/B 用求根公式得到: \(p-4q\geq0\) 换成熟悉的元: \(y-4x\geq0\) 其中: \(x:[-b,b] ...

  3. 数学概念——A 几何概型

    You are going from Dhaka to Chittagong by train and you came to know one of your old friends is goin ...

  4. UVa 11971 - Polygon(几何概型 + 问题转换)

    链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  5. UVa 11346 - Probability(几何概型)

    链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  6. 集训第六周 数学概念与方法 UVA 11722 几何概型

    ---恢复内容开始--- http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=31471 题意,两辆火车,分别会在[t1,t2],[ ...

  7. UVA 11346 Probability (几何概型, 积分)

    题目链接:option=com_onlinejudge&Itemid=8&page=show_problem&problem=2321">https://uva ...

  8. python数学第四天【古典概型】

  9. CF Gym 100187B A Lot of Joy (古典概型)

    题意:给两个一样的只含有26个小写字母的字符串,然后两个分别做一下排列,问如果对应位置的字母相等那么就愉悦值就加一,问愉悦值的期望是多少? 题解:只考虑两个序列相对的位置,那么就相当于固定一个位置,另 ...

随机推荐

  1. 为django项目配置celery的后台启动

    为root用户启动celery创建的脚本,该脚本的拥有者与使用者都必须是root .使用方法为 /etc/init.d/celeryd [start]|[stop]|[kill] 需增加两个文件 /e ...

  2. idea安装proto插件后不能识别.proto文件解决方案

     just had a try and it worked well. Could you please check "File Types" in IDEA? Open &quo ...

  3. leetcode python 042收集雨水

    '''给定n个非负整数表示每个条的宽度为1的高程图,计算下雨后能够捕获多少水.例如,鉴于[0,1,0,2,1,0,1,3,2,1,2,1],返回6.这个题要先算出盛满水后的高程图,减去前者就是雨水.盛 ...

  4. ECC算法软件保护中的应用

    椭圆曲线在软件注册保护的应用 我们知道将公开密钥算法作为软件注册算法的好处是Cracker很难通过跟踪验证算法得到注册机.下面,将简介一种利用Fp(a,b)椭圆曲线进行软件注册的方法. 软件作者按如下 ...

  5. jq后加标签的事件(live事件)

    在使用中  live可以对未来元素起作用(比如:js后加的div等)   live在jq1.9以上版本已经废除 原:$('#del').live('click',function(){}) 改:$(' ...

  6. jmeter测试计划元素执行顺序

    jmeter测试计划元素执行顺序 测试计划的元素是有序的,通过以下方式执行: 1–配置节点 2–前置处理器 3–定时器 4–取样器 5–后置处理器(只在有结果可用情况下执行) 6–断言(只在有结果可用 ...

  7. 基于springboot构建dubbo的入门demo

    之前记录了构建dubbo入门demo所需的环境以及基于普通maven项目构建dubbo的入门案例,今天记录在这些的基础上基于springboot来构建dubbo的入门demo:众所周知,springb ...

  8. stylus导入时 报错These relative modules were not found

    These relative modules were not found: * ./star48_@2x.png in ./node_modules/_css-loader@0.28.7@css-l ...

  9. 大数据处理N!(21<N<2000)

    输入: 每行输入1个正整数n,(0<n<1000 000) 输出: 对于每个n,输出n!的(十进制)位数 digit, 和最高位数firstNum.(n!约等于 firstNum * 10 ...

  10. C# 比较和排序(IComparable和IComparer以及它们的泛型实现)

    准备工作: 1.创建实体类:ClassInfo,默认想要对其按照班级学生数量进行排序 public class ClassInfo  { /// <summary> /// 班级名称 // ...