aboutsummaryrefslogtreecommitdiff
path: root/08-03-2022(Div.3)/B.cpp
blob: dd8bb5475e2226e616c0ccd1b8585ef415df88b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include<bits/stdc++.h>

using namespace std;

int modDiv(int r, int a){
    // law r % a == 0, return r-1 % a + r-1 /a, else return r % a + r /a;
    if(r % a == 0){
        return (r-1) % a + (r-1)/a;
    }
    return r % a + r / a;
}

int main(){
    int tt;
    while(tt--){
        cout << "tt: " << tt;
        int l, r, a;
        cin >> l >> r >> a;
        cout << modDiv(r, a);
    }

    return 0;
}