Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <queue>
- #include <algorithm>
- #include <string>
- #include <stack>
- #include <set>
- #include <map>
- #define pii pair <int,int>
- using namespace std;
- using ll = long long;
- using ld = long double;
- using db = double;
- void cv(vector <int> &v){
- for (auto x: v) cout<<x<<' ';
- cout<<"\n";
- }
- void cvl(vector <ll> &v){
- for (auto x: v) cout<<x<<' ';
- cout<<"\n";
- }
- void cvv(vector <vector <int> > &v){
- for (auto x: v) cv(x);
- cout<<"\n";
- }
- struct ipn{
- int x,y;
- };
- struct rpn{
- db x,y;
- };
- rpn div(rpn A, rpn B, db p, db q){
- rpn res;
- res.x = (q * A.x + p * B.x) / (p + q);
- res.y = (q * A.y + p * B.y) / (p+q);
- return res;
- }
- int main()
- {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- cout.precision(20);
- rpn a,b,c;
- cin>>a.x>>a.y>>b.x>>b.y>>c.x>>c.y;
- rpn d = div(a, b, 1, 1);
- rpn e = div(d, c, 1, 2);
- cout<<fixed<<e.x<<' '<<e.y<<"\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement