华中农业大学预赛 A

Description

Diao Ze likes math very much, especially problems about equation. Now there is a problem for Diao Ze, but he is too lazy to solve it and he asks you for help:

Giving two integers a  and b  , which satisfied the equation

Then your task is to calculate the value of x in the equation.

Input

The first line contains an integer T , indicating the total number of test cases. In each test case there is only one line contains two positive integers  and

Output

For each test case, output the answer in one line. The answer should be rounded to 2 digits after the decimal point.

Sample Input

2
1 2
3 2

Sample Output

2.00
0.67
时间: 2024-10-10 05:58:29

华中农业大学预赛 A的相关文章

华中农业大学预赛 B Handing Out Candies 余数的和

Problem B: Handing Out Candies Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 258  Solved: 19[Submit][Status][Web Board] Description After the 40th ACM-ICPC, Diao Yang is thinking about finding a girlfriend because he feels very lonely when doing ACM

2016华中农业大学预赛 E 想法题

Problem E: Balance Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 205  Solved: 64[Submit][Status][Web Board] Description Every night Diao Ze is dreaming about the gold medal in the 1540th">  ACM-ICPC World Final. Not only does it represent the hon

2016华中农业大学预赛 B 数学

Problem B: Handing Out Candies Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 272  Solved: 20[Submit][Status][Web Board] Description After the 40th ACM-ICPC, Diao Yang is thinking about finding a girlfriend because he feels very lonely when doing ACM

华中农业大学第五届程序设计大赛 (7/12)

今天实在累了,还有的题晚点补.... 题目链接:http://acm.hzau.edu.cn/problemset.php?page=3 题目:acm.hzau.edu.cn/5th.pdf A:Little Red Riding Hood 题意:给你n朵花,每朵花有个权值,然后每次取花最少要间隔k朵,求权值最大: 思路:简单dp: #pragma comment(linker, "/STACK:1024000000,1024000000") #include<iostream&

华中农业大学第五届程序设计大赛网络同步赛解题报告(转)

A.Little Red Riding Hood B.Choosy in Food •F[i]:从第I个点到终点的期望步数 •F[i] = (F[i + k] + k ) * P[k] •F[ed] = 0 •高斯消元求解 •注意存在从起点不能到达终点的情况 C.Friends •F[rt][len] :节点rt的子孙里,距离rt的为len的节点个数 •ans[rt][len] : 整棵树上,距离rt为len的节点个数 •F值一次简单的深搜可以得到 •而ans[rt][len] = F[rt][

华中农业大学新生赛C题

http://acm.hzau.edu.cn/problem.php?id=1099 题意: 输入两个整数 l 和 n,代表半径和output的保留小数点位数. 输出圆的面积,保留n位小数. 一开始觉得用抑制符就可以了,然后发现它保留的时候会四舍五入,所以不行. 知识主要用到了floor函数(返回不大于传参值的最大整数(double)类型)以及sprintf. AC代码: 1 #include <stdio.h> 2 #include <string.h> 3 #include &

华中农业大学第五届程序设计大赛网络同步赛题解

A.Little Red Riding Hood B.Choosy in Food •F[i]:从第I个点到终点的期望步数 •F[i] = (F[i + k] + k ) * P[k] •F[ed] = 0 •高斯消元求解 •注意存在从起点不能到达终点的情况 C.Friends •F[rt][len] :节点rt的子孙里,距离rt的为len的节点个数 •ans[rt][len] : 整棵树上,距离rt为len的节点个数 •F值一次简单的深搜可以得到 •而ans[rt][len] = F[rt][

华中农业大学第四届程序设计大赛网络同步赛 I

Problem I: Catching Dogs Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 1130  Solved: 292[Submit][Status][Web Board] Description Diao Yang keeps many dogs. But today his dogs all run away. Diao Yang has to catch them. To simplify the problem, we assu

华中农业大学第四届程序设计大赛网络同步赛 J

Problem J: Arithmetic Sequence Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 1766  Solved: 299[Submit][Status][Web Board] Description Giving a number sequence A with length n, you should choosing m numbers from A(ignore the order) which can form an