Advertisement
Guest User

Untitled

a guest
Jun 13th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstring>
  4. using namespace std;
  5. const int INF = 1000*1000*1000;
  6.  
  7.  
  8. int main()
  9.  
  10. {
  11.     int l,r; cin >> l >> r;
  12.     int k2 = 2;
  13.     int k3 = 3;
  14.  
  15.     int ans_rk2_ = r/k2;
  16.     int ans_rk3_ = r/k3;
  17.  
  18.     int ans_lk2_ = (l-1)/k2;
  19.     int ans_lk3_ = (l-1)/k3;
  20.  
  21.     int result_k2_ = ans_rk2_ - ans_lk2_ ;
  22.     int result_k3_ = ans_rk3_ - ans_lk3_ ;
  23.  
  24.     if(result_k2_ > result_k3_ )
  25.     {
  26.         cout << 2;
  27.     }
  28.     else
  29.     {
  30.         cout << 3;
  31.     }
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement