Educational Codeforces Round 58 (Rated for Div. 2) 1101A - Minimum Integer Solution
Problem Link: https://codeforces.com/problemset/problem/1101/A
Solution in C++:
- /// La ilaha illellahu muhammadur rasulullah
 - ///******Bismillahir-Rahmanir-Rahim******///
 - /// Abul Hasnat Tonmoy
 - /// Department of CSE,23rd batch
 - /// Islamic University,Bangladesh
 - ///**********ALLAH IS ALMIGHTY************///
 - #include <bits/stdc++.h>
 - using namespace std;
 - #define ll long long int
 - int main() {
 - ios_base::sync_with_stdio(0);
 - cin.tie(0);
 - ll q, l, r, d, i, ans;
 - cin >> q;
 - while (q--) {
 - cin >> l >> r >> d;
 - if (d < l || d > r)
 - cout << d << endl;
 - else
 - cout << ((r / d) + 1) * d << endl;
 - }
 - }
 


No comments