SHARE
TWEET

LUBB

a guest Jan 25th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int zaokruziBroj(double a)
  7. {
  8.     if((a-(int)a)!=0) return trunc(a)+1;
  9.     return a;
  10. }
  11.  
  12. int main()
  13. {
  14.     double p,q,r, br=0;
  15.     long long L, R;
  16.  
  17.     cin >> p >> q >> r >> L >> R;
  18.  
  19.     for(int i=0;i<=100;i++){
  20.         if(zaokruziBroj(i/p)+zaokruziBroj(i/q)+zaokruziBroj(i/r)>i){
  21.  
  22.             if(i>=L && i<=R){
  23.                 br++;
  24.             }
  25.  
  26.         }
  27.     }
  28.     cout << R-L-br+1 << endl;
  29.     return 0;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top