이모저모

14583 본문

BOJ

14583

Alpa 2017. 5. 22. 12:01


그림을 잘못그려서 ㅜㅜ

cos, sin을 이용하면 쉽게 구할 수 잇다.




#include <iostream> 

#include <iterator>

#include <algorithm> 

#include <vector>

#include <list>

#include <map>

#include <set>

#include <queue>

#include <stack>

#include <string>

#include <cmath>

#include <cstdio>

#include <cstring>

using namespace std;

#define MOD 1000000007

#define INF 2147483647

#define LNF 9223372036854775807

#define pb push_back

#define mp make_pair

typedef long long ll;

typedef unsigned long long ull;


float h,v;

int main () {

freopen("sample.txt", "r", stdin);

scanf("%f%f",&h,&v);

float a,b,c,d,e;

a = sqrt(h*h+v*v);

b = (a-h)*h/v;

c = sqrt(h*h+b*b);

d = h/c;

e = (v-b)*d;

printf("%.2f %.2f\n",c/2.,e);

return 0;

}



'BOJ' 카테고리의 다른 글

14577  (0) 2017.05.29
14552  (0) 2017.05.26
14573  (0) 2017.05.20
14579  (0) 2017.05.17
14568  (0) 2017.05.16
Comments