Educational Codeforces Round 58 (Rated for Div. 2) 1101A - Minimum Integer Solution


   

Problem Link:  https://codeforces.com/problemset/problem/1101/A

Solution in C++:

  1. /// La ilaha illellahu muhammadur rasulullah
  2. ///******Bismillahir-Rahmanir-Rahim******///
  3. /// Abul Hasnat Tonmoy
  4. /// Department of CSE,23rd batch
  5. /// Islamic University,Bangladesh
  6. ///**********ALLAH IS ALMIGHTY************///
  7. #include <bits/stdc++.h>
  8. using namespace std;
  9. #define ll long long int
  10. int main() {
  11. ios_base::sync_with_stdio(0);
  12. cin.tie(0);
  13. ll q, l, r, d, i, ans;
  14. cin >> q;
  15. while (q--) {
  16. cin >> l >> r >> d;
  17. if (d < l || d > r)
  18. cout << d << endl;
  19. else
  20. cout << ((r / d) + 1) * d << endl;
  21. }
  22. }

No comments

Most View Post

Recent post

RESTful APIs with CRUD Operations in Laravel 12| (2025)

  RESTful APIs serve as the foundation of modern web development. They follow a set of rules called Representational State Transfer (REST) t...

Powered by Blogger.