fork download
  1. #include <bits/stdc++.h>
  2. #define ll long long
  3. #define Accepted ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  4. using namespace std;
  5. ll arr[100005];
  6. ll tt(ll hh,ll mm)
  7. {
  8. return hh*60+mm;
  9.  
  10. }
  11. int main()
  12. {
  13. Accepted
  14. char cc;
  15. bool tr=0;
  16. string s,ss;
  17. ll a,ta,b,tb,hh,mm,st,et,cnt=0;
  18. cin>>a>>ta>>b>>tb>>hh>>cc>>mm;
  19. st=tt(hh,mm);
  20. et=st+ta;
  21. for(int i=5*60;i<24*60-1;i+=b)
  22. {
  23. if(i>st-tb&&i<et)
  24. cnt++;
  25. }
  26. cout<<cnt;
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 5444KB
stdin
Standard input is empty
stdout
Standard output is empty