#include #include #include #include #include #include #include using namespace std; int main(){ long long l,r,n; cin >> l >> r >> n; long long len=(r-l+1)/n; long long mo=(r-l+1)%n; vector a; vector cnt(n,0); for(long long i=0;i<=(r-l);i++){ long long temp=i+l; if(i>0){ if(temp%n==a[0])break; } a.push_back(temp%n); cnt[a[i]]+=len; if(i