Find Divisible (Codeforces 1096A)
Tags: Implement, math

You are given a range of positive integers from $$$l$$$ to $$$r$$$.Find such a pair of integers $$$(x, y)$$$ that $$$l \le x, y \le r$$$, $$$x \ne y$$$ and $$$x$$$ divides $$$y$$$.If there are multiple answers, print any of them.You are also asked to answer $$$T$$$ independent queries.

Input: The first line contains a single integer $$$T$$$ ($$$1 \le T \le 1000$$$) — the number of queries.Each of the next $$$T$$$ lines contains two integers $$$l$$$ and $$$r$$$ ($$$1 \le l \le r \le 998244353$$$) — inclusive borders of the range.It is guaranteed that testset only includes queries, which have at least one suitable pair.

Output: Print $$$T$$$ lines, each line should contain the answer — two integers $$$x$$$ and $$$y$$$ such that $$$l \le x, y \le r$$$, $$$x \ne y$$$ and $$$x$$$ divides $$$y$$$. The answer in the $$$i$$$-th line should correspond to the $$$i$$$-th query from the input.If there are multiple answers, print any of them.


Sample Inputs:
3
1 10
3 14
1 10

Sample Outputs:
1 7
3 9
5 10

Solution (Python):
for i in range(int(input())):
    (a, b) = map(int, input().split())
    if b % a == 0:
        print(a, b)
    else:
        for i in range(2, 10):
            if a * i <= b:
                print(a, a * i)
                break

Solution (Python):
for i in range(int(input())):
    (a, b) = map(int, input().split())
    if b % a == 0:
        print(a, b)
    else:
        for i in range(2, 10):
            if a * i <= b:
                print(a, a * i)
                break

Solution (Python):
for _ in range(int(input())):
    (l, r) = map(int, input().split())
    print(l, 2 * l)