Codeforces 1107B. Digital root Solution
Solve in C++:
- ///**********ALLAH IS ALMIGHTY************///
- ///AH Tonmoy
- ///Department of CSE,23rd Batch
- ///Islamic University,Bangladesh
- #include<iostream>
- #include<vector>
- using namespace std;
- int main()
- {
- long long n,t,a,b,r;
- cin>>t;
- while(t--)
- {
- cin>>a>>b;
- r=b+(9*(a-1));
- cout<<r<<endl;
- r=0;
- }
- }
No comments