fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int a,b;
  7. cin >> a >> b;
  8. if( (b-a) >= 4038)
  9. cout<<'0';
  10. else
  11. {
  12. int ans = 2018;
  13. for(int i=a;i<=b;i++)
  14. for(int j=i+1;j<=b;j++)
  15. {
  16. int now = ( (i%2019)*(j%2019) )%2019;
  17. if( now < ans )
  18. ans = now;
  19. }
  20. cout << ans ;
  21. }
  22. }
Success #stdin #stdout 0.01s 5516KB
stdin
1090 1091

stdout
2018