Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int d, l, a, b, n, s, w, cls, clw, ils, ilw, it, cs, cw, cc;
- float k, j;
- int st[501];
- bool sz, wo;
- int main()
- {
- ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
- cin>>d>>l>>a>>b>>n;
- for(int h=0; h<n; h++)
- {
- cin>>st[h];
- if(h==n-1)
- {
- st[n]=d-st[h];
- }
- if(h>0)
- {
- st[h]=st[h]-st[h-1];
- }
- }
- ils=(100*l)/a;
- ilw=(100*l)/b;
- //szybki
- int z=ils;
- for(int h=0; h<=n; h++)
- {
- if(st[h]>ils)
- {
- sz=true;
- }
- if(z<=st[h])
- {
- cls++;
- z=ils;
- it=h;
- z=z-st[h];
- }
- else if(z>st[h])
- {
- z=z-st[h];
- }
- }
- //wsciekly
- z=ilw;
- for(int h=0; h<=n; h++)
- {
- if(st[h]>ilw)
- {
- wo=true;
- }
- if(z<st[h])
- {
- clw++;
- z=ilw;
- it=h;
- z=z-st[h];
- }
- else if(z>=st[h])
- {
- z=z-st[h];
- }
- }
- k=(60*d/200);
- j=(60*d/100);
- cs=(cls*20)+k;
- cw=(clw*20)+j;
- if(sz==false && wo==false)
- {
- cc=min(cs, cw);
- }
- else if(sz==true)
- {
- cc=cw;
- }
- else
- {
- cc=cs;
- }
- if(cc%60!=0)
- {
- cout<<cc/60<<" h "<<cc%60<<" m"<<endl;
- }
- else
- {
- cout<<(cc/60)<<" h "<<"0 m"<<endl;
- }
- if((sz==true || cw<cs) && wo==false)
- {
- cout<<"wsciekly";
- }
- else
- {
- cout<<"szybki";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement