TOJ 2917.The Watchman

题目链接:http://acm.tju.edu.cn/toj/showp2917.html


2917.    The Watchman
Time Limit: 1.0 Seconds    Memory Limit: 65536K
Total Runs: 1120    Accepted Runs: 491



The military academy often employs some of their agents to keep their eyes on the susceptible areas. Suppose MN is the barracks for the soldiers and BC are two blocks within it. The commander sent two soldiers from block B and C destined to the location A. The two soldiers were going to their destination on the direction ofBA and CA respectively. Both of them were inspecting the areas on their left and right. But when they were reached exactly on the halfway to their destination A, both of them were sent back to the barracks for an emergency need. So, both the soldiers returned to the pavilion on the shortest paths. They made an area of common observation EFPQ i.e. watched by both the soldiers. You have to calculate the side of the common observation area EFQP, if it can be recognized as a square.

Input

You are given the triangular area of AEF. You should keep it in mind that the common area EFQP will not be necessarily become a square always but you can treat this area as an equivalent of a square. E and F are the mid points of AB and AC respectively. Each input will be given in a single line. Input is terminated by a negative number.

Output

You have to calculate the side of the square that is equivalent to the area EFQP. The output should be correct to two decimal places.

Sample input

100
653
2099
-1

Sample output

14.14
36.14
64.79

Problem Setter: Samina Azad (CSE - 03)



Source: CUET individual contest
Submit   List    Runs   Forum   Statistics

水题,三角形中位线性质

#include <stdio.h>
#include <cmath>
int main(){
	double n;
	while(scanf("%lf",&n)&&n>=0)
		printf("%.2lf\n",(sqrt(n*2)));
} 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值