Codeforces 1107B. Digital root Solution

Solve in  C++:

  1. ///**********ALLAH IS ALMIGHTY************///
  2. ///AH Tonmoy
  3. ///Department of CSE,23rd Batch
  4. ///Islamic University,Bangladesh
  5. #include<iostream>
  6. #include<vector>
  7. using namespace std;
  8. int main()
  9. {
  10. long long n,t,a,b,r;
  11. cin>>t;
  12. while(t--)
  13. {
  14. cin>>a>>b;
  15. r=b+(9*(a-1));
  16. cout<<r<<endl;
  17. r=0;
  18. }
  19. }

No comments

Most View Post

Recent post

Codeforces Round 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

  Problem Link    https://codeforces.com/contest/2009/problem/C S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. h ...

Powered by Blogger.