简单几何(推公式) UVA 11646 Athletics Track

时间:2022-04-03 16:38:13

题目传送门

题意:给了长宽比例,操场一圈400米,问原来长宽的长度

分析:推出公式

/************************************************
* Author :Running_Time
* Created Time :2015/10/22 星期四 15:19:59
* File Name :UVA_11646.cpp
************************************************/ #include <cstdio>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <bitset>
#include <cstdlib>
#include <ctime>
using namespace std; #define lson l, mid, rt << 1
#define rson mid + 1, r, rt << 1 | 1
typedef long long ll;
const int N = 1e5 + 10;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const double EPS = 1e-10; int main(void) {
int l, w, cas = 0;
while (scanf ("%d : %d", &l, &w) == 2) {
double a = w * 1.0 / l;
double rad = atan (a);
double L = 200.0 / (1 + rad * a / sin (rad));
double W = a * L;
printf ("Case %d: %.10f %.10f\n", ++cas, L, W);
} return 0;
}