fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, m;
  6. cin >> n >> m;
  7. int a = n / 5;
  8. int b = m / 5;
  9. long long ans = 5 * a * b;
  10. int as = n % 5;
  11. int bs = m % 5;
  12. for(int i = 1; i <= as; i++) {
  13. for(int j = 1; j <= bs; j++) {
  14. if((i + j) % 5 == 0) ans++;
  15. }
  16. }
  17. cout << ans + as * b + bs * a << endl;
  18. //1 2 3 4 0 1 2 3 4 0 1
  19. //1 2 3 4 0 1 2 3 4 0 1 2 3 4
  20. return 0;
  21. }
Success #stdin #stdout 0s 3460KB
stdin
6 12
stdout
14