Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <iomanip>
- #include <queue>
- using namespace std;
- ifstream f("dstar.in");
- ofstream g("dstar.out");
- int r,p,i,n;
- double u,s,x;
- priority_queue<double> v;
- int main()
- {
- f>>r>>p;
- for(i=1;i<=r;i++)
- {
- f>>u;
- s+=u;
- v.push(u);
- }
- v.push(360-s);
- for(i=1;i<=p;i++)
- {
- x=v.top();
- v.pop();
- v.push(x/2);
- v.push(x/2);
- }
- x=v.top();
- g<<fixed<<setprecision(6)<<x;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement