oval-and-rectangleTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 876 Accepted Submission(s): 380 Problem Description Patrick Star find an oval.
Input The first line contain a integer T (no morn than 10), the following is T test case, for each test case :
Output For each test case output one line denotes the expectations of the rectangle's perimeter .
Sample Input 1 2 1
Sample Output 8.283185
Source 2018 Multi-University Training Contest 6
Recommend chendu | We have carefully selected several similar problems for you: 6373 6372 6371 6370 6369
|
积分
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
int main(void)
{
int T;
cin >> T;
double ans;
while(T--) {
double a,b;
cin >> a >> b;
ans = a * pi + 2 * b;
ans -= 0.0000005;
printf("%.6lf\n",ans);
}
return 0;
}