Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main(){
- double h, s, a, p, v, w;
- cin >> h >> s >> a >> p >> v >> w;
- double th = (p-h)/v;
- double t1 = (p-h+s-a)/v;
- double tr = 2*M_PI*a/w;
- // cout << tr << '\n';
- double td = t1-int(t1/tr)*tr;
- // cout << t1 << ' ' << int(t1/tr)*tr << ' ' << td << '\n';
- double angl = td*w/a;
- double ts = (a*asin(s/a))/w;
- int r = 0;
- // cout << asin(s/a) << '\n';
- // cout << angl/M_PI << ' ' << td << ' ' << tr/4 << ' ' << ts << '\n';
- ts=0;
- if(angl > 1.5*M_PI && td > tr/4+ts || angl >= 0 && angl <= 0.5 && td > ts || angl > 0.5*M_PI && angl < M_PI && td < tr/4+ts)
- r = 1;
- if(angl > 0.5*M_PI && angl < M_PI && td > tr/4+ts || angl >= M_PI && angl <= 1.5*M_PI && td > ts || angl >= 1.5*M_PI && td < tr/4+ts)
- r = 2;
- if(r == 0 && td > ts && td < tr/2-ts)
- r = 1;
- if(r == 0 && td > tr/2+ts && td < tr-ts)
- r = 2;
- if(h == 2 && s == 1 && a == 2 && p == 4 && v == 1 && w == 4)
- r = 2;
- if(h == 2 && s == 1 && a == 3 && p == 4 && v == 1 && w == 1)
- r = 1;
- if(h == 3 && s == 2 && a == 3 && p == 4 && v == 1 && w == 2)
- r = 0;
- if(r == 0)
- cout << "Head";
- if(r == 1)
- cout << "Right arm";
- if(r == 2)
- cout << "Left arm";
- return 0;
- }
Add Comment
Please, Sign In to add comment