diff options
| author | Omar Magdy <omar.professional8777@gmail.com> | 2022-05-06 23:23:53 +0200 |
|---|---|---|
| committer | Omar Magdy <omar.professional8777@gmail.com> | 2022-05-06 23:23:53 +0200 |
| commit | ed4b0690e4ee35278bb656c703bd0a1ab102222f (patch) | |
| tree | fc880ae4d999fbd54e6d370073eb18291da475cd /08-03-2022(Div.3)/B_DIV_MOD.cpp | |
| parent | 27b754215ceda985f0f8e3b64ab5c5f8e84ab826 (diff) | |
| download | competitive-programming-ed4b0690e4ee35278bb656c703bd0a1ab102222f.tar.xz competitive-programming-ed4b0690e4ee35278bb656c703bd0a1ab102222f.zip | |
Added some problems + moved some folders to contests
Diffstat (limited to '08-03-2022(Div.3)/B_DIV_MOD.cpp')
| -rw-r--r-- | 08-03-2022(Div.3)/B_DIV_MOD.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/08-03-2022(Div.3)/B_DIV_MOD.cpp b/08-03-2022(Div.3)/B_DIV_MOD.cpp deleted file mode 100644 index f861b3b..0000000 --- a/08-03-2022(Div.3)/B_DIV_MOD.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#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; - cin >> tt; - while(tt--){ - int l, r, a; - cin >> l >> r >> a; - cout << modDiv(r, a) << endl; - } - - return 0; -} |
