Advertisement
ileetavcioski

Baksis

Apr 25th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int x,y;
  8.     cin>>x>>y;
  9.     int mincena,makscena;
  10.  
  11.     mincena=ceil(20.0*x/19.0);
  12.     makscena=floor(10.0*x/9.0);
  13.  
  14.     if(makscena>y) makscena=y;
  15.  
  16.     if(mincena%5!=0)
  17.         mincena+=5-(mincena%5);
  18.  
  19.     if(makscena%5!=0)
  20.         makscena-=(makscena%5);
  21.  
  22.     if(mincena>makscena)
  23.         cout<<0<<endl;
  24.     else
  25.         cout<<(makscena-mincena)/5+1;
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement