UVA12578 10:6:2【数学】

The national flag of Bangladesh is bottle green in color and rectangular in size with the length (L) to width ratio of 10:6. It bears a red circle on the background of green. It maintains the length (L) to radius ratio of 5:1 (If the length is 10 then width should be 6 and radius should be 2). The color in the background represents the greenery of Bangladesh while the red circle symbolizes the rising sun and the sacrifice of lives in our freedom fight.


Input

First line of input will contain the number of test cases, T ≤ 100. Then there follows T lines, each containing a positive integer L ≤ 1000, representing length of the flag.

Output

For each test case output is a line with two space separated real numbers containing exactly two digits after decimal point. Two numbers represent the area of red and green portion respectively.

Note: Pi is considered to be arccos(−1).

Sample Input

1

10

Sample Output

12.57 47.43


问题链接UVA12578 10:6:2

问题简述

  孟加拉国的国旗是由绿色长方形和一个红色圆圈构成,长方形长度 (L) 与宽度比为10:6。长方形长度 (L) 与圆半径比为5:1。计算红色与绿色的面积比。

问题分析

  几何计算题,不解释。

程序说明:(略)

题记:(略)


参考链接:(略)


AC的C++语言程序如下:

/* UVA12578 10:6:2 */

#include <bits/stdc++.h>

using namespace std;

const double PI = acos(-1.0);

int main()
{
    int t, l;
    double w, r;

    scanf("%d", &t);
    while(t--) {
        scanf("%d", &l);

        w = 0.6 * l;
        r = 0.2 * l;

        printf("%.2f %.2f\n", PI * r * r, w * l - PI * r * r);
    }

    return 0;
}


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值