ll sol(int n, int m, int d){ ll ans = 0; if(n > m) swap(n, m); n /= d, m /= d; for(int i = 1, j ; i <= n ; i = j + 1) { j = min(n / (n / i), m / (m / i)); ans += (ll) (mu[j] - mu[i - 1]) * (n / i) * (m / i); } return ans; }
voidsol(){ int a, b, c, d, k; scanf("%d%d%d%d%d", &a, &b, &c, &d, &k); ll ans = sol(b, d, k) + sol(a - 1, c - 1, k) - sol(a - 1, d, k) - sol(b, c - 1, k); printf("%lld\n", ans); }