A. Find Divisible
https://codeforces.com/problemset/problem/1096/A
l과 r이 주어지는데, 그 사이에 배수관계인 수를 찾는 문제이다.
항상 쌍이 존재한다는 것이 보장되므로, 그리디하게 l과 2*l을 출력하면 된다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include <bits/stdc++.h> using namespace std; int n, a, b; int main() { ios::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); cin >> n; while (n--) { cin >> a >> b; cout << a << ' ' << a * 2 << '\n'; } return 0; } | cs |
'Competition > codeforces' 카테고리의 다른 글
Educational Codeforces Round 56 (Rated for Div. 2) B. Letters Rearranging (0) | 2019.03.28 |
---|---|
Codeforces Round #529 (Div. 3) B. Array Stabilization (0) | 2019.03.28 |
Hello 2019 A. Gennady and a Card Game (0) | 2019.03.28 |
Codeforces Round #530 (Div. 2) A. Snowball (0) | 2019.03.28 |
Codeforces Round #532 (Div. 2) A. Roman and Browser (0) | 2019.03.28 |