acm--Mathematics--Xiang da oj 1088--cycloid

Source: Internet
Author: User
Tags acos


Xiang da OJ title address: Portal


Cycloid time limit: +Ms | Memory Limit:65536Kb


Description

A cycloid is the curve traced to a point in the rim of a circular wheel as the wheel rolls along a straight line. It is an example of a roulette, a curve generated by a curve rolling on another curve.


--from Wikipedia

Calculate the area of an arch of a cycloid generated by a circle of radius R.

Define PI as ACOs (-1.0).

Input

the first line of the input consists of a single integer K (1 <= k <=), denoting the number of test cases . Then K lines follow, each contains a real number R (0.0 < R < 1E3), indicating the radius of circle.

Output

for each test case, output a line containing one real number with exactly three digits after the decimal point, Indica Ting The area of an arch.

Sample Input

2

1.0

3.5

Sample Output

9.425

115.454


================================== 's Split Line =================================


The area of the arc that the circle passes through, this has a formula, the area that the cycloid leaves is equal to three times times the circle


#include <stdio.h> #include <iostream> #include <math.h>using namespace Std;int main () {    int n;    Double R;    scanf ("%d", &n);    while (n--) {       cin>>r;       Double X=3*acos ( -1.0) *r*r;       printf ("%.3f\n", x);    }}




acm--Mathematics--Xiang da oj 1088--cycloid

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.